Update to gcc-9-20180729#699
Update to gcc-9-20180729#699ibuclaw merged 2 commits intoD-Programming-GDC:masterfrom belka-ew:gcc-9-20180722
Conversation
gcc/d/gdc.texi
Outdated
| where a pragma that is part of the D language, but not implemented by | ||
| the compiler, will not get reported. | ||
|
|
||
| @item -Walloca-larger-than=@var{n} |
There was a problem hiding this comment.
Should keep it ASCII collated with the other arguments.
gcc/d/lang.opt
Outdated
| D | ||
| ; Documented in C | ||
|
|
||
| Walloca-larger-than= |
There was a problem hiding this comment.
ASCII collation (move it up with the other Wxxx options).
|
Do you have an example to hand of what's warning? Not just a code example, but the warning message given. Also, how big is too big for alloca? |
No idea. Anyway, as I see it, druntime should be fixed to handle it properly.
So it doesn't just return By the way, I can't reproduce the segfault on slackware; though I haven't tried ubuntu yet. |
|
What change was made to make the testsuite start passing? |
|
And secondly, rather than adding a new option, can we just change druntime directly? And raise a PR upstream to address it also. |
Nothing changed; I couldn't reproduce this locally either.
We can. Why |
Just an arbitrary restriction really, the important thing to ensure is that can be cast to signed. It looks like the compiler warning default is for any size that may be bigger than half the address space ( |
|
|
|
I reverted the makefiles and adjusted the runtime. But should we keep the option itself? |
|
I'll raise a PR upstream in the next days. |
The assert is just for the unittest runner. It would be ignored in release build. Just a cast would be more than enough. It's going to be very unlikely that we have to alloca a data type bigger than ptrdiff_t anyway, let alone 8Mb. |
|
This is the comment in relation to the alloca warning: |
|
FYI: https://gcc.gnu.org/ml/gcc-patches/2018-07/msg01805.html As for the druntime patch, I think there should be a limit applied on the size given to |
|
Let us see what druntime people say. I'll try to prepare a PR during today. |
|
Initially, gcc reviewers seem sceptical of moving alloca related warnings to common, so I guess will have to concede that point and move them here then. |
| D | ||
| ; Documented in common.opt | ||
|
|
||
| Walloca-larger-than= |
There was a problem hiding this comment.
Might as well add all Walloca warning options and documentation.
There was a problem hiding this comment.
I think this is fine, just needs the following updates:
- Add
Walloca,Walloca-larger-than=andWno-alloca-larger-thanto language options. - Leave out druntime patch for now, on the promise that it will be dealt with upstream soon - it will be merged as soon as its in.
Do I understand it correctly that
And add |
These are all definitions in c.opt, they should be mirrored to make sure that no warnings about unsupported option happens. It also means that each would show up in
But we don't compile with |
I used
Let's see :) |
|
I don't believe it. It may be wiser to make that |
The PR adds new
- Walloca-larger-thanand-Wno-alloca-larger-thancommand line switches.-Wno-alloca-larger-thanis applied when building druntime since the code like following fails otherwise (rt/arrayassign.d):