Re: [patch, fortran] PR50555 synonymous namelist/statement function dummy argument not allowed
Hi Jerry, Attached patch adds diagnostics to catch this. Test case included. Regression tested on x86-64 OK for trunk? OK. Thanks for the patch! Thomas
Re: [PATCH] Make C++ use the enum mode attribute
On 06.02.2016 at 23:37 Trevor Saunders wrote: > On Sat, Feb 06, 2016 at 08:36:27PM +, Bernd Edlinger wrote: >> >> Hi Jakub, >> >> as a follow-up for your c/69669 fix, I'd like to have the enum mode also >> honored >> in C++ code, because the mode attribute now finally really works in C, but >> it is >> completely and silently(!) ignored by C++ code, which results in incompatible >> code. >> >> So I duplicated what is done in c/c-decl.c also in cp/decl.c. That worked >> immediately, except that it is not possible to explicitly check the "mode" >> attribute in the TYPE_ATTRIBUTES (enumtype) because that attribute >> is never copied to the type, and the original attribute list is not available >> here. That should be OK, as this check was added to fix pr52085 which >> does not apply here, because C++ does not support enum forward >> declarations. > > it is allowed if you do something like > > enum X : int; > Oh I see, that is new in C++11. I was referring to a GCC extension of the C syntax: enum X; /* enum X can be used here to declare pointers for instance */ enum X { A=1, B=2 }; That syntax is not understood by C++, while the enum with an underlying type is not understood by C code. The mode attribute is understood by both. BTW I tried: enum __attribute__((packed)) X : short; enum X : short { x1 = 1, x2 = 2 }; here the packed attribute is ignored, again without a warning. There was a warning for that in gcc4.8 at least. I think the warning is not generated because the decl_attributes does not see the underlying type. Thus, does the following look reasonable? Index: decl.c === --- decl.c (revision 233200) +++ decl.c (working copy) @@ -13180,8 +13180,6 @@ start_enum (tree name, tree enumtype, tree underly SET_SCOPED_ENUM_P (enumtype, scoped_enum_p); - cplus_decl_attributes (&enumtype, attributes, (int)ATTR_FLAG_TYPE_IN_PLACE); - if (underlying_type) { if (CP_INTEGRAL_TYPE_P (underlying_type)) @@ -13196,6 +13194,8 @@ start_enum (tree name, tree enumtype, tree underly underlying_type, enumtype); } + cplus_decl_attributes (&enumtype, attributes, (int)ATTR_FLAG_TYPE_IN_PLACE); + /* If into a template class, the returned enum is always the first declaration (opaque or not) seen. This way all the references to this type will be to the same declaration. The following ones are used > but it seems really pointless to support setting the size of something > when the language gives you a standard way to do that. > This is about interoperability with C code. And that is really essential IMO. Thanks Bernd. >> If that patch is not appropriate for stage 4, I would at least want to emit >> an attribute directive ignored warning in c++ mode. I think that could >> be done in handle_mode_attribute. But fixing that feature is cooler. > > Its definitely bad to sighlently ignore the attribute. On one hand > being compatable with C seems nice, but on the other hand in C++ 11 and > later you can set the size without using attributes, and the mode thing > has always seemed a bit odd to me since its not really clear what C > type they corespond to. > > Trev > >> >> Boot-strapped and regression tested on x86_64-pc-linux-gnu. >> Ok for trunk? >> >> >> Thanks >> Bernd. > >> cp: >> 2016-02-06 Bernd Edlinger >> >> * decl.c (finish_enum_value_list): Use the specified mode. >> >> testsuite: >> 2016-02-06 Bernd Edlinger >> >> * c-c++-common/pr69669.c: Check the used mode. > >> Index: gcc/cp/decl.c >> === >> --- gcc/cp/decl.c(Revision 233176) >> +++ gcc/cp/decl.c(Arbeitskopie) >> @@ -13310,6 +13310,19 @@ finish_enum_value_list (tree enumtype) >> use_short_enum = flag_short_enums >> || lookup_attribute ("packed", TYPE_ATTRIBUTES (enumtype)); >> >> + /* If the precision of the type was specified with an attribute and it >> + was too small, give an error. Otherwise, use it. */ >> + if (TYPE_PRECISION (enumtype)) >> +{ >> + if (precision > TYPE_PRECISION (enumtype)) >> +error ("specified mode too small for enumeral values"); >> + else >> +{ >> + use_short_enum = true; >> + precision = TYPE_PRECISION (enumtype); >> +} >> +} >> + >> for (itk = (use_short_enum ? itk_char : itk_int); >> itk != itk_none; >> itk++) >> Index: gcc/testsuite/c-c++-common/pr69669.c >> === >> --- gcc/testsuite/c-c++-common/pr69669.c (Revision 233176) >> +++ gcc/testsuite/c-c++-common/pr69669.c (Arbeitskopie) >> @@ -1,5 +1,6 @@ >> /* PR c/69669 */ >> /* { dg-do compile } */ >> +/* { dg-options "-fdump-rtl-final" } */ >> >> enum __attribute__((mode(QI))) E { F = 1 }; >> >> @@ -8,3 +9,5 @@ foo (enum E
[wwwdocs] main page -- shorten/reduce size of request for further news
Shorten the request for further news. Use global CSS, thus practically also reducing font size when being served from gcc.gnu.org. Applied Gerald Index: index.html === RCS file: /cvs/gcc/wwwdocs/htdocs/index.html,v retrieving revision 1.995 diff -u -r1.995 index.html --- index.html 6 Feb 2016 23:18:43 - 1.995 +++ index.html 7 Feb 2016 11:36:57 - @@ -96,8 +96,8 @@ https://gcc.gnu.org/news.html";>Older news | http://nickclifton.livejournal.com/";>Nick's Blog | - -Any additions? Don't be shy, send them to ger...@pfeifer.com! + +More news? Let ger...@pfeifer.com know!
[wwwdocs] Replace by on index.html
I noticed we have some unnatural vertical whitespace here (and have had for years, but this became more exposed when I played a little bit with font sizes). Fixed thusly. Gerald Index: index.html === RCS file: /cvs/gcc/wwwdocs/htdocs/index.html,v retrieving revision 1.996 diff -u -r1.996 index.html --- index.html 7 Feb 2016 11:38:12 - 1.996 +++ index.html 7 Feb 2016 11:56:14 - @@ -115,15 +115,14 @@ https://gcc.gnu.org/ml/gcc/2015-12/msg00051.html";>2015-12-04 (regression fixes and docs only). - - + https://gcc.gnu.org/bugzilla/buglist.cgi?query_format=advanced&short_desc_type=regexp&short_desc=%5C[([ 0-9.%2F]*[ %2F])*5[ %2F][ 0-9.%2F]*[Rr]egression *%5C]&target_milestone=4.9.4&target_milestone=5.4&known_to_fail_type=allwordssubstr&known_to_work_type=allwordssubstr&long_desc_type=allwordssubstr&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&gcchost_type=allwordssubstr&gcchost=&gcctarget_type=allwordssubstr&gcctarget=&gccbuild_type=allwordssubstr&gccbuild=&keywords_type=allwords&keywords=&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=SUSPENDED&bug_status=WAITING&bug_status=REOPENED&priority=P1&priority=P2&priority=P3&emailtype1=substring&email1=&emailtype2=substring&email2=&bugidtype=include&bug_id=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Reuse+same+sort+as+ last+time&field0-0-0=noop&type0-0-0=noop&value0-0-0=">Serious regressions. https://gcc.gnu.org/bugzilla/buglist.cgi?query_format=advanced&short_desc_type=regexp&short_desc=%5C[([ 0-9.%2F]*[ %2F])*5[ %2F][ 0-9.%2F]*[Rr]egression *%5C]&target_milestone=4.9.4&target_milestone=5.4&known_to_fail_type=allwordssubstr&known_to_work_type=allwordssubstr&long_desc_type=allwordssubstr&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&gcchost_type=allwordssubstr&gcchost=&gcctarget_type=allwordssubstr&gcctarget=&gccbuild_type=allwordssubstr&gccbuild=&keywords_type=allwords&keywords=&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=SUSPENDED&bug_status=WAITING&bug_status=REOPENED&emailtype1=substring&email1=&emailtype2=substring&email2=&bugidtype=include&bug_id=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Reuse+same+sort+as+last+time&field0-0-0=noop&type0-0-0=noop &value0-0-0=">All regressions. - + GCC 4.9.3 @@ -134,15 +133,14 @@ https://gcc.gnu.org/ml/gcc/2015-06/msg00260.html";>2015-06-26 (regression fixes and docs only). - - + https://gcc.gnu.org/bugzilla/buglist.cgi?query_format=advanced&short_desc_type=allwordssubstr&short_desc=4.9&target_milestone=4.9.4&known_to_fail_type=allwordssubstr&known_to_work_type=allwordssubstr&long_desc_type=allwordssubstr&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&gcchost_type=allwordssubstr&gcchost=&gcctarget_type=allwordssubstr&gcctarget=&gccbuild_type=allwordssubstr&gccbuild=&keywords_type=allwords&keywords=&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=SUSPENDED&bug_status=WAITING&bug_status=REOPENED&priority=P1&priority=P2&priority=P3&emailtype1=substring&email1=&emailtype2=substring&email2=&bugidtype=include&bug_id=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Reuse+same+sort+as+last+time&field0-0-0=noop&type0-0-0=noop&value0-0-0=";>Serious regressions. https://gcc.gnu.org/bugzilla/buglist.cgi?query_format=advanced&short_desc_type=allwordssubstr&short_desc=4.9&target_milestone=4.9.4&known_to_fail_type=allwordssubstr&known_to_work_type=allwordssubstr&long_desc_type=allwordssubstr&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&gcchost_type=allwordssubstr&gcchost=&gcctarget_type=allwordssubstr&gcctarget=&gccbuild_type=allwordssubstr&gccbuild=&keywords_type=allwords&keywords=&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=SUSPENDED&bug_status=WAITING&bug_status=REOPENED&emailtype1=substring&email1=&emailtype2=substring&email2=&bugidtype=include&bug_id=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Reuse+same+sort+as+last+time&field0-0-0=noop&type0-0-0=noop&value0-0-0=";>All regressions. - + Development: @@ -154,15 +152,14 @@ https://gcc.gnu.org/ml/gcc/2016-01/msg00168.html";>2016-01-20 (regression fixes and docs only). - - + https://gcc.gnu.org/bugzilla/buglist.cgi?query_format=advanced&short_desc_type=regexp&short_desc=%5C[([ 0-9.%2F]*[ %2F])*6[ %2F][ 0-9.%2F]*[Rr]egression *%5C]&target_milestone=4.9.4&target_milestone=5.4&target_milestone=6.0&known_to_fail_type=allwordssubstr&known_to_work_type=allwordssubstr&long_desc_type=allwordssubstr&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&gcchost_type=allwordssubstr&gcchost=&gcctarget_type=allwordssubstr&gcctarget=&gccbuild_type=allwordssubstr&gccbuild=&keywords_type=allwords&keywords=&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=SUSPENDED&bug_statu
[PATCH] testsuite/s390: Add __morestack test.
gcc/testsuite/ChangeLog: * gcc.target/s390/morestack.c: New test. --- Here's the promised test. gcc/testsuite/ChangeLog | 4 + gcc/testsuite/gcc.target/s390/morestack.c | 260 ++ 2 files changed, 264 insertions(+) create mode 100644 gcc/testsuite/gcc.target/s390/morestack.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8f528b2..26d600f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2016-02-05 Marcin Kościelnicki : + + * gcc.target/s390/morestack.c: New test. + 2016-02-04 Martin Liska * g++.dg/asan/pr69276.C: New test. diff --git a/gcc/testsuite/gcc.target/s390/morestack.c b/gcc/testsuite/gcc.target/s390/morestack.c new file mode 100644 index 000..aa28b72 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/morestack.c @@ -0,0 +1,260 @@ +/* Checks proper behavior of __morestack function - specifically, GPR + values surviving, stack parameters being copied, and vararg + pointer being correct. */ + +/* { dg-do run } */ +/* { dg-options "" } */ + +#include + +void *orig_r15; + +/* 1. Function "test" saves registers, makes a stack frame, puts known + *values in registers, and calls __morestack, telling it to jump to + *testinner, with return address pointing to "testret". + * 2. "testinner" checks that parameter registers match what has been + *passed from "test", stack parameters were copied properly to + *the new stack, and the argument pointer matches the calling + *function's stack pointer. It then leaves new values in volatile + *registers (including return value registers) and returns. + * 3. "testret" checks that return value registers contain the expected + *return value, callee-saved GPRs match the values from "test", + *and then returns to main. */ + +extern unsigned long testparams[3]; + +#ifdef __s390x__ + +asm( + ".global test\n" + "test:\n" + ".type test, @function\n" + /* Save registers. */ + "stmg %r6, %r15, 0x30(%r15)\n" + /* Save original sp in a global. */ + "larl %r1, orig_r15\n" + "stg %r15, 0(%r1)\n" + /* Make a stack frame. */ + "aghi %r15, -168\n" + /* A stack parameter. */ + "lghi %r1, 0x1240\n" + "stg %r1, 160(%r15)\n" + /* Registers. */ + "lghi %r0, 0x1230\n" + "lghi %r2, 0x1232\n" + "lghi %r3, 0x1233\n" + "lghi %r4, 0x1234\n" + "lghi %r5, 0x1235\n" + "lghi %r6, 0x1236\n" + "lghi %r7, 0x1237\n" + "lghi %r8, 0x1238\n" + "lghi %r9, 0x1239\n" + "lghi %r10, 0x123a\n" + "lghi %r11, 0x123b\n" + "lghi %r12, 0x123c\n" + "lghi %r13, 0x123d\n" + /* Fake return address. */ + "larl %r14, testret\n" + /* Call morestack. */ + "larl %r1, testparams\n" + "jg __morestack\n" + + /* Entry point. */ + "testinner:\n" + /* Check registers. */ + "cghi %r0, 0x1230\n" + "jne testerr\n" + "cghi %r2, 0x1232\n" + "jne testerr\n" + "cghi %r3, 0x1233\n" + "jne testerr\n" + "cghi %r4, 0x1234\n" + "jne testerr\n" + "cghi %r5, 0x1235\n" + "jne testerr\n" + "cghi %r6, 0x1236\n" + "jne testerr\n" + /* Check stack param. */ + "lg %r0, 0xa0(%r15)\n" + "cghi %r0, 0x1240\n" + "jne testerr\n" + /* Check argument pointer. */ + "aghi %r1, 8\n" + "larl %r2, orig_r15\n" + "cg %r1, 0(%r2)\n" + "jne testerr\n" + /* Modify volatile registers. */ + "lghi %r0, 0x1250\n" + "lghi %r1, 0x1251\n" + "lghi %r2, 0x1252\n" + "lghi %r3, 0x1253\n" + "lghi %r4, 0x1254\n" + "lghi %r5, 0x1255\n" + /* Return. */ + "br %r14\n" + + /* Returns here. */ + "testret:\n" + /* Check return registers. */ + "cghi %r2, 0x1252\n" + "jne testerr\n" + /* Check callee-saved registers. */ + "cghi %r6, 0x1236\n" + "jne testerr\n" + "cghi %r7, 0x1237\n" + "jne testerr\n" + "cghi %r8, 0x1238\n" + "jne testerr\n" + "cghi %r9, 0x1239\n" + "jne testerr\n" + "cghi %r10, 0x123a\n" + "jne testerr\n" + "cghi %r11, 0x123b\n" + "jne testerr\n" + "cghi %r12, 0x123c\n" + "jne testerr\n" + "cghi %r13, 0x123d\n" + "jne testerr\n" + /* Return. */ + "lmg %r6, %r15, 0xd8(%r15)\n" + "br %r14\n" + + /* Parameters block. */ + ".section .data\n" + ".align 8\n" + "testparams:\n" + ".quad 160\n" + ".quad 8\n" + ".quad testinner-testparams\n" + ".text\n" +); + +#else + +asm( + ".global test\n" + "test:\n" + ".type test, @function\n" + /* Save registers. */ + "stm %r6, %r15, 0x18(%r15)\n" + /* Save original sp in a global. */ + "larl %r1, orig_r15\n" + "st %r15, 0(%r1)\n" + /* Make a stack frame. */ + "ahi %r15, -0x68\n" + /* A stack parameter. */ + "lhi %r1, 0x1240\n" + "st %r1, 0x60(%r15)\n" + "lhi %r1, 0x1241\n" + "st %r1, 0x64(%r15)\n" + /* Registers. */ + "lhi %r0, 0x1230\n" + "lhi %r2, 0x1232\n" + "lhi %r3, 0x1233\n" + "lhi %r4, 0x1234\n" + "lhi %r5, 0x1235\n" + "lhi %r6, 0x1236\n" + "lhi %r7, 0x1237\n" + "lhi %r8, 0x1238\n" + "lhi %r9, 0x1239\n" + "lhi %r10, 0x123a\n" + "lhi %r11, 0x123b\n" + "lhi %r12, 0x123c\n" + "lhi %r13, 0x123d\n" + /* Fake return
New Swedish PO file for 'gcc' (version 6.1-b20160131)
Hello, gentle maintainer. This is a message from the Translation Project robot. A revised PO file for textual domain 'gcc' has been submitted by the Swedish team of translators. The file is available at: http://translationproject.org/latest/gcc/sv.po (This file, 'gcc-6.1-b20160131.sv.po', has just now been sent to you in a separate email.) All other PO files for your package are available in: http://translationproject.org/latest/gcc/ Please consider including all of these in your next release, whether official or a pretest. Whenever you have a new distribution with a new version number ready, containing a newer POT file, please send the URL of that distribution tarball to the address below. The tarball may be just a pretest or a snapshot, it does not even have to compile. It is just used by the translators when they need some extra translation context. The following HTML page has been updated: http://translationproject.org/domain/gcc.html If any question arises, please contact the translation coordinator. Thank you for all your work, The Translation Project robot, in the name of your translation coordinator.
Re: Remove -fshort-double (PR60410)
On Fri, 5 Feb 2016, Jeff Law wrote: > Shouldn't c-opt.def be changed to note the option is deprecated and ignored > rather than totally removing it? No. That's appropriate with optimization options which can safely be ignored, not with options such as this that have an incompatible effect on ABI or API. -- Joseph S. Myers jos...@codesourcery.com
Re: [PATCH] Remove PTX link option
Hi Alexander! On Fri, 29 Jan 2016 18:12:06 +0300, Alexander Monakov wrote: > On Mon, 11 Jan 2016, Alexander Monakov wrote: > > > On Mon, 11 Jan 2016, Thomas Schwinge wrote: > > > Alexander, would you please also submit a fix for that for nvptx-tools' > > > nvptx-run.c? (Or want me to do that?) > > > > I can do that, along with another small change I used for -mgomp testing. > > I have now done that as part of nvptx-tools pull request #10 here: > https://github.com/MentorEmbedded/nvptx-tools/pull/10 > (the pull request also addresses other issues noted on the project's tracker) Thanks, all merged. Grüße Thomas
[wwwdocs] index.html -- make section on releases a bit denser
While I worked on avoiding local styles, I noticed a couple of things on the main page (and a couple others). This is one of them that makes the main page a little liker. Make section on releases a bit denser: Rename it from "Release Series and Status" to just "Releases", replace "and" by ampersand for release status, and reduce font size for Bugzilla linkes to regressions. Applied. Gerald Index: gcc.css === RCS file: /cvs/gcc/wwwdocs/htdocs/gcc.css,v retrieving revision 1.32 diff -u -r1.32 gcc.css --- gcc.css 6 Feb 2016 23:18:43 - 1.32 +++ gcc.css 7 Feb 2016 15:03:25 - @@ -26,7 +26,7 @@ td.status h2 { font-size: 1.2em; margin-top:0; margin-bottom: 1%; } td.status dl { margin-top:0; } td.status .version { font-weight:bold; } -td.status .regress { font-size: 90%; } +td.status .regress { font-size: 80%; } td.status dd { margin-left:3ex; } .td_title { Index: index.html === RCS file: /cvs/gcc/wwwdocs/htdocs/index.html,v retrieving revision 1.997 diff -u -r1.997 index.html --- index.html 7 Feb 2016 12:07:00 - 1.997 +++ index.html 7 Feb 2016 15:03:25 - @@ -104,7 +104,7 @@ -Release Series and Status +Releases GCC 5.3 @@ -114,7 +114,7 @@ https://gcc.gnu.org/ml/gcc/2015-12/msg00051.html";>2015-12-04 - (regression fixes and docs only). + (regression fixes & docs only). https://gcc.gnu.org/bugzilla/buglist.cgi?query_format=advanced&short_desc_type=regexp&short_desc=%5C[([ 0-9.%2F]*[ %2F])*5[ %2F][ 0-9.%2F]*[Rr]egression *%5C]&target_milestone=4.9.4&target_milestone=5.4&known_to_fail_type=allwordssubstr&known_to_work_type=allwordssubstr&long_desc_type=allwordssubstr&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&gcchost_type=allwordssubstr&gcchost=&gcctarget_type=allwordssubstr&gcctarget=&gccbuild_type=allwordssubstr&gccbuild=&keywords_type=allwords&keywords=&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=SUSPENDED&bug_status=WAITING&bug_status=REOPENED&priority=P1&priority=P2&priority=P3&emailtype1=substring&email1=&emailtype2=substring&email2=&bugidtype=include&bug_id=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Reuse+same+sort+as+ last+time&field0-0-0=noop&type0-0-0=noop&value0-0-0=">Serious @@ -132,7 +132,7 @@ https://gcc.gnu.org/ml/gcc/2015-06/msg00260.html";>2015-06-26 - (regression fixes and docs only). + (regression fixes & docs only). https://gcc.gnu.org/bugzilla/buglist.cgi?query_format=advanced&short_desc_type=allwordssubstr&short_desc=4.9&target_milestone=4.9.4&known_to_fail_type=allwordssubstr&known_to_work_type=allwordssubstr&long_desc_type=allwordssubstr&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&gcchost_type=allwordssubstr&gcchost=&gcctarget_type=allwordssubstr&gcctarget=&gccbuild_type=allwordssubstr&gccbuild=&keywords_type=allwords&keywords=&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=SUSPENDED&bug_status=WAITING&bug_status=REOPENED&priority=P1&priority=P2&priority=P3&emailtype1=substring&email1=&emailtype2=substring&email2=&bugidtype=include&bug_id=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Reuse+same+sort+as+last+time&field0-0-0=noop&type0-0-0=noop&value0-0-0=";>Serious @@ -151,7 +151,7 @@ https://gcc.gnu.org/ml/gcc/2016-01/msg00168.html";>2016-01-20 - (regression fixes and docs only). + (regression fixes & docs only). https://gcc.gnu.org/bugzilla/buglist.cgi?query_format=advanced&short_desc_type=regexp&short_desc=%5C[([ 0-9.%2F]*[ %2F])*6[ %2F][ 0-9.%2F]*[Rr]egression *%5C]&target_milestone=4.9.4&target_milestone=5.4&target_milestone=6.0&known_to_fail_type=allwordssubstr&known_to_work_type=allwordssubstr&long_desc_type=allwordssubstr&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&gcchost_type=allwordssubstr&gcchost=&gcctarget_type=allwordssubstr&gcctarget=&gccbuild_type=allwordssubstr&gccbuild=&keywords_type=allwords&keywords=&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=SUSPENDED&bug_status=WAITING&bug_status=REOPENED&priority=P1&priority=P2&priority=P3&emailtype1=substring&email1=&emailtype2=substring&email2=&bugidtype=include&bug_id=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit& order=Reuse+same+sort+as+last+time&field0-0-0=noop&type0-0-0=noop&value0-0-0=">Serious
[PATCH] PR c++/69139
PR c++/69139 * cp/parser.c (cp_parser_simple_type_specifier): Don't mistake 'auto' in trailing return function pointer types as an implicit template parameter. PR c++/69139 * g++.dg/cpp0x/trailing12.C: New test. --- gcc/cp/parser.c | 22 ++ gcc/testsuite/g++.dg/cpp0x/trailing12.C | 6 ++ 2 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 gcc/testsuite/g++.dg/cpp0x/trailing12.C diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index d03b0c9..c1a9674 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -16029,8 +16029,11 @@ cp_parser_simple_type_specifier (cp_parser* parser, maybe_warn_cpp0x (CPP0X_AUTO); if (parser->auto_is_implicit_function_template_parm_p) { - /* The 'auto' might be the placeholder return type for a function decl -with trailing return type. */ + /* The 'auto' might be the placeholder return type for a function type +with trailing return type. Look for a '->' after parameter list. +Handle pointer-to-function, function reference and +pointer-to-member-function by tentatively consuming two pairs of +parens before testing for '->'. */ bool have_trailing_return_fn_decl = false; if (cp_lexer_peek_nth_token (parser->lexer, 2)->type == CPP_OPEN_PAREN) @@ -16042,8 +16045,19 @@ cp_parser_simple_type_specifier (cp_parser* parser, /*recovering*/false, /*or_comma*/false, /*consume_paren*/true)) - have_trailing_return_fn_decl - = cp_lexer_next_token_is (parser->lexer, CPP_DEREF); + { + if (cp_lexer_next_token_is (parser->lexer, CPP_DEREF)) + have_trailing_return_fn_decl = true; + else if ((cp_lexer_consume_token (parser->lexer)->type + == CPP_OPEN_PAREN) + && (cp_parser_skip_to_closing_parenthesis + (parser, + /*recovering*/false, + /*or_comma*/false, + /*consume_paren*/true))) + have_trailing_return_fn_decl + = cp_lexer_next_token_is (parser->lexer, CPP_DEREF); + } cp_parser_abort_tentative_parse (parser); } diff --git a/gcc/testsuite/g++.dg/cpp0x/trailing12.C b/gcc/testsuite/g++.dg/cpp0x/trailing12.C new file mode 100644 index 000..f3e02a8 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/trailing12.C @@ -0,0 +1,6 @@ +// PR c++/69139 +// { dg-do compile { target c++11 } } + +auto get(int) -> int { return {}; } +template int f(auto (*)(int) -> R) { return {}; } +int i = f(get); -- 2.7.0
Re: [PATCH][wwwdocs] Add blurb to top of gcc-6/changes.html
On Fri, 5 Feb 2016, Kyrill Tkachov wrote: > + > +This page is a brief summary of the huge number of improvements made to > +GCC in GCC 6. For more information, see the > +Porting to GCC 6 page and the > +full GCC documentation. > + > > I'd say "brief summary of some of the huge number of improvements..." > as we don't summarise all of the improvements made ;) Agreed. And how about "improvements in GCC 6" as opposed to "to GCC in GCC 6"? This is fine with these changes, David, and a good idea to begin with. Thanks, Gerald
Re: Remove -fshort-double (PR60410)
On 02/07/2016 07:30 AM, Joseph Myers wrote: On Fri, 5 Feb 2016, Jeff Law wrote: Shouldn't c-opt.def be changed to note the option is deprecated and ignored rather than totally removing it? No. That's appropriate with optimization options which can safely be ignored, not with options such as this that have an incompatible effect on ABI or API. Good point. In that case I think the patch is fine as-is. jeff
Re: Wonly-top-basic-asm
Hey Bernd. I replied with a patch that includes most of the changes you asked for (see inline below). Were you waiting on me for something more? I have cleaned up the testcases so they aren't so i386-specific, but otherwise this patch (attached) is the same. Let me know if there is something more I need to do here. Thanks, dw On 1/27/2016 11:20 PM, David Wohlferd wrote: Rumors that I earn a commission for every person I switch to the "extended asm" plan are completely unfounded... :) That said, I truly believe there are very few cases where using basic asm within a function makes sense. What's more, either they currently work incorrectly and need to be found and fixed, or they are going to take a performance hit when the new "clobber everything" semantics are implemented. So yeah, I pushed pretty hard to have the docs say "DON'T USE IT!" But reading it all again, you are right: It's too much. On 1/25/2016 4:25 AM, Bernd Schmidt wrote: On 01/24/2016 11:23 PM, David Wohlferd wrote: +Wonly-top-basic-asm +C ObjC ObjC++ C++ Var(warn_only_top_basic_asm) Warning +Warn on unsafe uses of basic asm. Maybe just -Wbasic-asm? Hmm. Maybe. I've never been completely satisfied with that name. But wouldn't this sound like it would warn on all uses of basic asm? The intent is to only flag the ones in functions. They are the ones with all the problems. What would you say to -Wbasic-asm-in-function? A little verbose... +/* Warn on basic asm used inside of functions, + EXCEPT when in naked functions. Also allow asm(""). */ Two spaces after a sentence. Fixed. +if (warn_only_top_basic_asm && (TREE_STRING_LENGTH (str) != 1) ) Unnecessary parens, and extra space before closing paren. Fixed. + if (warn_only_top_basic_asm && + (TREE_STRING_LENGTH (string) != 1)) Extra parens, and && goes first on the next line. Fixed. + warning_at(asm_loc, OPT_Wonly_top_basic_asm, Space before "(". Fixed. +"asm statement in function does not use extended syntax"); Could break that into ".." "..." over two lines so as to keep indentation. Fixed. -asm (""); +asm ("":::); Is that necessary? As far as I can tell we're treating these equally. While you are correct that today they are treated (nearly) equally, if Jeff does what he plans for v7, asm("") is going to translate (on x64) to: asm("":::"rax", "rbx", "rcx", "rdx", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", "rdi", "rsi", "rbp", "cc", "memory"); Given that, it seemed appropriate for the docs to start steering people away from basic. This particular instance was just something that was mentioned during the discussion. However, that's for someday. Maybe "someday" will turn into some other solution. And since I'm not prepared to go thru all the docs and change all the other basic asms at this time, I removed this change. @@ -7487,6 +7490,8 @@ consecutive in the output, put them in a single multi-instruction @code{asm} statement. Note that GCC's optimizers can move @code{asm} statements relative to other code, including across jumps. +Using inputs and outputs with extended @code{asm} can help correctly position +your asm. Not sure this is needed either. Sounds a bit like advertising :) In general the doc changes seem much too verbose to me. I didn't think about this until it was brought up during the discussion. But once it was pointed out to me, it made sense. However, at your suggestion I have removed this. +Extended @code{asm}'s @samp{%=} may help resolve this. Same here. I think the block that recommends extended asm is good enough. I think the next part could be shrunk significantly too. Removed. -Here is an example of basic @code{asm} for i386: +Basic @code{asm} statements within functions do not perform an implicit +"memory" clobber (@pxref{Clobbers}). Also, there is no implicit clobbering +of @emph{any} registers, so (other than "naked" functions which follow the "other than in"? Also @code{naked} maybe. It works for me either way. Since it bothers you, I changed it. I'd place a note about clobbering after the existing "To access C data, it is better to use extended asm". +ABI rules) changed registers must be restored to their original value before +exiting the @code{asm}. While this behavior has not always been documented, +GCC has worked this way since at least v2.95.3. Also, lacking inputs and +outputs means that GCC's optimizers may have difficulties consistently +positioning the basic @code{asm} in the generated code. The existing text already mentions ordering issues. Lose this block. I've removed the rest of the paragraph after "Also" Wait, didn't you tell me to remove the other mention of 'ordering'? I think I've removed all of them now. Not a huge loss, but was that what you intended? +The concept of ``clobbering'' does not apply to basic @code{asm} statem
[PATCH] Fix PR c++/66786 (ICE with nested lambdas in variable template)
Here, we are calling template_class_depth on a FIELD_DECL corresponding to a lambda that is used inside variable template. template_class_depth however does not see that this FIELD_DECL is used inside a variable template binding because its chain of DECL_CONTEXTs does not include the corresponding VAR_DECL. So template_class_depth returns the wrong template nesting level which causes its callers to malfunction. In particular we strip a template argument level in tsubst_copy [FIELD_DECL] when we shouldn't have. This patch makes template_class_depth look at a lambda type's LAMBDA_TYPE_EXTRA_SCOPE field instead of its TYPE_CONTEXT, so that it can iterate into an enclosing variable template, if applicable. Tested on x86_64-pc-linux gnu, no new regressions. Also tested against Boost. Is this OK to commit? gcc/cp/ChangeLog: PR c++/66786 * pt.c (template_class_depth): Given a lambda type, iterate into its LAMBDA_TYPE_EXTRA_SCOPE field instead of its TYPE_CONTEXT. Given a VAR_DECL, iterate into its CP_DECL_CONTEXT. gcc/testsuite/ChangeLog: PR c++/66786 * g++.dg/cpp1y/var-templ48.C: New test. * g++.dg/cpp1y/var-templ49.C: New test. --- gcc/cp/pt.c | 12 gcc/testsuite/g++.dg/cpp1y/var-templ48.C | 5 + gcc/testsuite/g++.dg/cpp1y/var-templ49.C | 9 + 3 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 gcc/testsuite/g++.dg/cpp1y/var-templ48.C create mode 100644 gcc/testsuite/g++.dg/cpp1y/var-templ49.C diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 4d405cf..5c344c1 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -369,16 +369,20 @@ template_class_depth (tree type) { int depth; - for (depth = 0; - type && TREE_CODE (type) != NAMESPACE_DECL; - type = (TREE_CODE (type) == FUNCTION_DECL) -? CP_DECL_CONTEXT (type) : CP_TYPE_CONTEXT (type)) + for (depth = 0; type && TREE_CODE (type) != NAMESPACE_DECL; ) { tree tinfo = get_template_info (type); if (tinfo && PRIMARY_TEMPLATE_P (TI_TEMPLATE (tinfo)) && uses_template_parms (INNERMOST_TEMPLATE_ARGS (TI_ARGS (tinfo ++depth; + + if (VAR_OR_FUNCTION_DECL_P (type)) + type = CP_DECL_CONTEXT (type); + else if (LAMBDA_TYPE_P (type)) + type = LAMBDA_TYPE_EXTRA_SCOPE (type); + else + type = CP_TYPE_CONTEXT (type); } return depth; diff --git a/gcc/testsuite/g++.dg/cpp1y/var-templ48.C b/gcc/testsuite/g++.dg/cpp1y/var-templ48.C new file mode 100644 index 000..f0c7693 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/var-templ48.C @@ -0,0 +1,5 @@ +// PR c++/66786 +// { dg-do compile { target c++14 } } + +template auto list = [](T... xs) { [=](auto f) { f(xs...); }; }; +int main() { list(0); } diff --git a/gcc/testsuite/g++.dg/cpp1y/var-templ49.C b/gcc/testsuite/g++.dg/cpp1y/var-templ49.C new file mode 100644 index 000..cd3f230 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/var-templ49.C @@ -0,0 +1,9 @@ +// PR c++/66786 +// { dg-do compile { target c++14 } } + +int f (int, bool); + +template +auto list = [](auto... xs) { return [=](auto f, auto... ys) { return f(xs..., ys...); }; }; + +const int &a = list(0, true)(f); -- 2.7.1.257.g925a48d
Correct c-torture stkalign test
This test was added by git commit 7c5f55675 (svn 231569) Here's the log message from that commit: avoid alignment of static variables affecting stack's Function (or more narrow) scope static variables (as well as others not placed on the stack) should also not have any effect on the stack alignment. I noticed the issue first with Linux'es dynamic_pr_debug() construct using an 8-byte aligned sub-file-scope local variable. However, the test assumes that a local var will normally not be 64-bit aligned, causing it to fail on many targets. So the test needs to pass if the local var *is* normally 64-bit aligned. Done as follows. test2() is a duplicate of test() without the alignment on the static vars. Fails on x86_64 -m64 and -m32 if 7c5f55675 is reverted and passes now for powerpc64-linux. I expect sparc will pass too, so have reverted Eric's change. OK to apply? PR testsuite/68886 * gcc.c-torture/execute/stkalign.c: Revise test. diff --git a/gcc/testsuite/gcc.c-torture/execute/stkalign.c b/gcc/testsuite/gcc.c-torture/execute/stkalign.c index 2f8d041..e10a1d2 100644 --- a/gcc/testsuite/gcc.c-torture/execute/stkalign.c +++ b/gcc/testsuite/gcc.c-torture/execute/stkalign.c @@ -1,5 +1,6 @@ -/* { dg-xfail-run-if "invalid assumption" { sparc*-*-* && lp64 } "*" "" } */ /* { dg-options "-fno-inline" } */ +/* Check that stack alignment is not affected by variables not placed + on the stack. */ #include @@ -16,12 +17,28 @@ unsigned test(unsigned n, unsigned p) return n ? test(n - 1, x) : (x ^ p); } +unsigned test2(unsigned n, unsigned p) +{ + static struct { char c; } s; + unsigned x; + + assert(__alignof__(s) != ALIGNMENT); + asm ("" : "=g" (x), "+m" (s) : "0" (&x)); + + return n ? test2(n - 1, x) : (x ^ p); +} + int main (int argc, char *argv[] __attribute__((unused))) { - unsigned int x = test(argc, 0); + unsigned int x, y; + x = test(argc, 0); x |= test(argc + 1, 0); x |= test(argc + 2, 0); - return !(x & (ALIGNMENT - 1)); + y = test2(argc, 0); + y |= test2(argc + 1, 0); + y |= test2(argc + 2, 0); + + return (x & (ALIGNMENT - 1)) == 0 && (y & (ALIGNMENT - 1)) != 0 ? 1 : 0; } -- Alan Modra Australia Development Lab, IBM
[PATCH] Fix PR 69282: ICE on 464.h264ref at -O3
Hi, The problem is that even though expand knows how to expand VEC_COND when there is no vcond_mask pattern, expand_vec_cond_expr_p returns false. So this patch allows expand_vec_cond_expr_p to try the next part of the function if there is no vcond_mask pattern. OK? Bootstrapped and tested on aarch64-linux-gnu with no regressions. Thanks, Andrew Pinski ChangeLog: * optabs-tree.c (expand_vec_cond_expr_p): Don't early return if get_vcond_mask_icode returns false. Testsuite/ChangeLog: * gcc.c-torture/compile/20160205-1.c: New testcase. Index: optabs-tree.c === --- optabs-tree.c (revision 233202) +++ optabs-tree.c (working copy) @@ -323,8 +323,11 @@ expand_vec_cond_expr_p (tree value_type, machine_mode value_mode = TYPE_MODE (value_type); machine_mode cmp_op_mode = TYPE_MODE (cmp_op_type); if (VECTOR_BOOLEAN_TYPE_P (cmp_op_type)) -return get_vcond_mask_icode (TYPE_MODE (value_type), -TYPE_MODE (cmp_op_type)) != CODE_FOR_nothing; +{ + if (get_vcond_mask_icode (TYPE_MODE (value_type), + TYPE_MODE (cmp_op_type)) != CODE_FOR_nothing) + return true; +} if (GET_MODE_SIZE (value_mode) != GET_MODE_SIZE (cmp_op_mode) || GET_MODE_NUNITS (value_mode) != GET_MODE_NUNITS (cmp_op_mode) || get_vcond_icode (TYPE_MODE (value_type), TYPE_MODE (cmp_op_type), Index: testsuite/gcc.c-torture/compile/20160205-1.c === --- testsuite/gcc.c-torture/compile/20160205-1.c(revision 0) +++ testsuite/gcc.c-torture/compile/20160205-1.c(working copy) @@ -0,0 +1,8 @@ +int a[32]; +int fn1(int d) { + int c = 1; + for (int b = 0; b < 32; b++) +if (a[b]) + c = 0; + return c; +}
AW: Wonly-top-basic-asm
On 8. 2. 2016 04:45, David Wohlferd wrote: > Hey Bernd. > > I replied with a patch that includes most of the changes you asked for > (see inline below). Were you waiting on me for something more? > ChangeLog entries are still missing. > I have cleaned up the testcases so they aren't so i386-specific, but > otherwise this patch (attached) is the same. Let me know if there is > something more I need to do here. > > Thanks, > dw David, there is a tool that you can use to check the patch for some style-nits before submission. I used it and it complains about these things: contrib/check_GNU_style.sh 24414Q.patch Blocks of 8 spaces should be replaced with tabs. 29:+DECL_ATTRIBUTES (current_function_decl)) 30:+ == NULL_TREE) 31:+warning_at (asm_loc, OPT_Wonly_top_basic_asm, 32:+"asm statement in function does not use extended syntax"); 57:+ EXCEPT when in naked functions. Also allow asm(""). */ 59:+ && TREE_STRING_LENGTH (string) != 1) 60:+if (lookup_attribute("naked", 61:+ DECL_ATTRIBUTES (current_function_decl)) 62:+== NULL_TREE) 63:+ warning_at (asm_loc, OPT_Wonly_top_basic_asm, 64:+ "asm statement in function does not use extended" 65:+ " syntax"); Trailing whitespace. 25:+/* Warn on basic asm used inside of functions, 28:+ if (lookup_attribute ("naked", 29:+DECL_ATTRIBUTES (current_function_decl)) 31:+warning_at (asm_loc, OPT_Wonly_top_basic_asm, Dot, space, space, end of comment. 122:+/* Define macro at file scope with basic asm. */ 123:+/* Add macro parameter p to eax. */ 130:+/* the "a" constraint since it modifies eax. */ 186:+ /* basic asm should not warn in naked functions. */ Sentences should end with a dot. Dot, space, space, end of the comment. 128:+/* Use macro in function using extended asm. It needs */ 129:+/* the "cc" clobber since the flags are changed and uses */ 187:+ asm(" "); /* no warning */ 203:+/* acceptable */ 209:+/* acceptable */ 212:+/* acceptable */ 215:+/* acceptable */ 221:+ /* acceptable */ 227:+ /* acceptable */ 230:+ /* acceptable */ 233:+ /* acceptable */ 236:+ /* warning */ There should be exactly one space between function name and parentheses. 10:+C ObjC ObjC++ C++ Var(warn_only_top_basic_asm) Warning 26:+ EXCEPT when in naked functions. Also allow asm(""). */ 57:+ EXCEPT when in naked functions. Also allow asm(""). */ 60:+if (lookup_attribute("naked", 124:+asm(".macro test p\n\t" 131:+int DoAdd(int value) 133:+ asm("test 5" : "+a" (value) : : "cc"); 187:+ asm(" "); /* no warning */ 190:+int main(int argc, char *argv[]) 192:+ return func(argc, argc); 202:+#if defined(__i386__) || defined(__x86_64__) 204:+register int b asm("esi"); 218:+int main(int argc, char *argv[]) 220:+#if defined(__i386__) || defined(__x86_64__) 222:+ register int a asm("edi"); 228:+ asm(" "::"r"(a), "r" (b)); 234:+ asm(""); 237:+ asm(" "); /* { dg-warning "does not use extended syntax" } */ Well regarding line 10 that is of course correct syntax. And I looked with vi at gcc/testsuite/c-c++-common/Wonly-top-basic-asm.c it seems to be using mixed windows and unix style line endings. I would use unix line endings wherever possible, for consistency. Thanks Bernd.