[Bug tree-optimization/60003] [4.9 regression] wrong code with __builtin_setjmp/__builtin_longjmp and inlining
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60003 --- Comment #10 from Jakub Jelinek jakub at gcc dot gnu.org --- Author: jakub Date: Sat Feb 1 08:40:31 2014 New Revision: 207382 URL: http://gcc.gnu.org/viewcvs?rev=207382root=gccview=rev Log: PR tree-optimization/60003 * gimple-low.c (lower_builtin_setjmp): Set cfun-has_nonlocal_label. * profile.c (branch_prob): Use gimple_call_builtin_p to check for BUILT_IN_SETJMP_RECEIVER. * tree-inline.c (copy_bb): Call notice_special_calls. * gcc.c-torture/execute/pr60003.c: New test. Added: trunk/gcc/testsuite/gcc.c-torture/execute/pr60003.c Modified: trunk/gcc/ChangeLog trunk/gcc/gimple-low.c trunk/gcc/profile.c trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-inline.c
[Bug bootstrap/59985] stage2/3 compare error on lto-streamer-in.o
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59985 Jakub Jelinek jakub at gcc dot gnu.org changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #15 from Jakub Jelinek jakub at gcc dot gnu.org --- Supposedly fixed.
[Bug c/60021] New: Inconsistent -Wsign-compare warnings for -O0 and -O1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60021 Bug ID: 60021 Summary: Inconsistent -Wsign-compare warnings for -O0 and -O1 Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: chengniansun at gmail dot com Gcc emits a -Wsign-compare warning for the following test case with the optimization flag -O0, but no warning with -O1. $: cat s.c.v2.c typedef long int64_t; void fn1(unsigned, char, long); void fn1(unsigned p_26, char c, long l) { /**/ const char l_1051 = 0; int64_t *l_1059 = l; char *l_1062 = c; p_26 (*l_1062 = (1L == (*l_1059 = 0)) = l_1051); } $: gcc-trunk -c -Wsign-compare -O0 s.c s.c: In function ‘fn1’: s.c:7:8: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] p_26 (*l_1062 = (1L == (*l_1059 = 0)) = l_1051); ^ $: gcc-trunk -c -Wsign-compare -O1 s.c $: gcc-trunk -v Using built-in specs. COLLECT_GCC=gcc-trunk COLLECT_LTO_WRAPPER=/home/chengniansun/tools/gcc-trunk-binaries/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../gcc-trunk/configure --enable-languages=c,c++ --disable-multilib --prefix=/home/chengniansun/tools/gcc-trunk-binaries : (reconfigured) ../gcc-trunk/configure --enable-languages=c,c++ --disable-multilib --prefix=/home/chengniansun/tools/gcc-trunk-binaries : (reconfigured) ../gcc-trunk/configure --enable-languages=c,c++ --disable-multilib --prefix=/home/chengniansun/tools/gcc-trunk-binaries Thread model: posix gcc version 4.9.0 20140131 (experimental) (GCC) $:
[Bug c/60021] Inconsistent -Wsign-compare warnings for -O0 and -O1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60021 --- Comment #1 from Chengnian Sun chengniansun at gmail dot com --- Interestingly, if I remove the typedef typedef long int64_t;, the warning is gone. $: cat s.c void fn1(unsigned, char, long); void fn1(unsigned p_26, char c, long l) { /**/ const char l_1051 = 0; long *l_1059 = l; char *l_1062 = c; p_26 (*l_1062 = (1L == (*l_1059 = 0)) = l_1051); } $: gcc-trunk -c -O0 -Wsign-compare s.c $: gcc-trunk -c -O1 -Wsign-compare s.c $
[Bug tree-optimization/60003] [4.9 regression] wrong code with __builtin_setjmp/__builtin_longjmp and inlining
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60003 Jakub Jelinek jakub at gcc dot gnu.org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|--- |FIXED --- Comment #11 from Jakub Jelinek jakub at gcc dot gnu.org --- Fixed.
[Bug c++/51219] [4.7/4.8/4.9 regression] ICE with empty bit-fields
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51219 --- Comment #6 from paolo at gcc dot gnu.org paolo at gcc dot gnu.org --- Author: paolo Date: Sat Feb 1 09:24:42 2014 New Revision: 207383 URL: http://gcc.gnu.org/viewcvs?rev=207383root=gccview=rev Log: /cp 2014-02-01 Paolo Carlini paolo.carl...@oracle.com PR c++/51219 * typeck2.c (process_init_constructor_record): Just skip unnamed bit-fields. /testsuite 2014-02-01 Paolo Carlini paolo.carl...@oracle.com PR c++/51219 * g++.dg/init/bitfield5.C: New. Added: trunk/gcc/testsuite/g++.dg/init/bitfield5.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/typeck2.c trunk/gcc/testsuite/ChangeLog
[Bug c++/51219] [4.7/4.8 regression] ICE with empty bit-fields
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51219 Paolo Carlini paolo.carlini at oracle dot com changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|--- |FIXED Assignee|paolo.carlini at oracle dot com|unassigned at gcc dot gnu.org Target Milestone|4.7.4 |4.9.0 Summary|[4.7/4.8/4.9 regression]|[4.7/4.8 regression] ICE |ICE with empty bit-fields |with empty bit-fields --- Comment #7 from Paolo Carlini paolo.carlini at oracle dot com --- Fixed for 4.9.0. The problem happens only with checking enabled, I'm not going to propose a backport to 4.8.
[Bug tree-optimization/60023] New: [4.9 Regression] ICE: verify_gimple failed: dead STMT in EH table with -O3 -fnon-call-exceptions -mavx2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60023 Bug ID: 60023 Summary: [4.9 Regression] ICE: verify_gimple failed: dead STMT in EH table with -O3 -fnon-call-exceptions -mavx2 Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: zsojka at seznam dot cz Created attachment 32008 -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=32008action=edit partially reduced testcase Compiler output: $ gcc -O3 -fnon-call-exceptions -mavx2 -std=c++0x testcase.C testcase.C: In function 'void __copy_move_b(_Bit_iterator, _Bit_iterator)': testcase.C:110:6: error: dead STMT in EH table void __copy_move_b (_Bit_iterator __last, _Bit_iterator __result) ^ # VUSE .MEM_81 _55 = *SR.55_29(D); testcase.C:110:6: error: dead STMT in EH table # .MEM_89 = VDEF .MEM_79 *SR.53_41(D) = _45; testcase.C:110:6: error: dead STMT in EH table # .MEM_90 = VDEF .MEM_80 *SR.54_35(D) = _51; testcase.C:110:6: error: dead STMT in EH table # .MEM_91 = VDEF .MEM_81 *SR.55_29(D) = _57; testcase.C:110:6: error: dead STMT in EH table # .MEM_88 = VDEF .MEM_78 *SR.52_47(D) = _39; testcase.C:110:6: error: dead STMT in EH table # VUSE .MEM_82 _61 = *SR.56_23(D); testcase.C:110:6: error: dead STMT in EH table # VUSE .MEM_22 _25 = *SR.50_1(D); testcase.C:110:6: error: dead STMT in EH table # VUSE .MEM_83 _67 = *SR.57_105(D); testcase.C:110:6: error: dead STMT in EH table # VUSE .MEM_77 _31 = *SR.51_8(D); testcase.C:110:6: error: dead STMT in EH table # VUSE .MEM_84 _73 = *SR.58_106(D); testcase.C:110:6: error: dead STMT in EH table # .MEM_92 = VDEF .MEM_82 *SR.56_23(D) = _63; testcase.C:110:6: error: dead STMT in EH table # .MEM_86 = VDEF .MEM_22 *SR.50_1(D) = _27; testcase.C:110:6: error: dead STMT in EH table # .MEM_93 = VDEF .MEM_83 *SR.57_105(D) = _69; testcase.C:110:6: error: dead STMT in EH table # .MEM_87 = VDEF .MEM_77 *SR.51_8(D) = _33; testcase.C:110:6: error: dead STMT in EH table # .MEM_94 = VDEF .MEM_84 *SR.58_106(D) = _75; testcase.C:110:6: error: dead STMT in EH table # VUSE .MEM_78 _37 = *SR.52_47(D); testcase.C:110:6: error: dead STMT in EH table # VUSE .MEM_79 _43 = *SR.53_41(D); testcase.C:110:6: error: dead STMT in EH table # VUSE .MEM_80 _49 = *SR.54_35(D); testcase.C:110:6: internal compiler error: verify_gimple failed 0xd16113 verify_gimple_in_cfg(function*) /mnt/svn/gcc-trunk/gcc/tree-cfg.c:4940 0xbf10b2 execute_function_todo /mnt/svn/gcc-trunk/gcc/passes.c:1853 0xbf1a03 execute_todo /mnt/svn/gcc-trunk/gcc/passes.c:1887 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See http://gcc.gnu.org/bugs.html for instructions. This source contains uninitialised variables, but the original unreduced testcase didn't.
[Bug preprocessor/60022] New: macro _(Text) generates warning: implicit declaration of function '_' [-Wimplicit-function-declaration]
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60022 Bug ID: 60022 Summary: macro _(Text) generates warning: implicit declaration of function '_' [-Wimplicit-function-declaration] Product: gcc Version: 4.8.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: preprocessor Assignee: unassigned at gcc dot gnu.org Reporter: richard at netbsd dot org I believe I'm up against a regression in gcc 4.8.3 building the package rpm-4.11.1 I witness the following: rpmfileutil.c: In function 'rpmMkTempFile': rpmfileutil.c:255:2: warning: implicit declaration of function '_' [-Wimplicit-function-declaration] rpmlog(RPMLOG_ERR, _(error creating temporary file %s: %m\n), tempfn); ^ rpmfileutil.c:255:2: warning: passing argument 2 of 'rpmlog' makes pointer from integer without a cast [enabled by default] In file included from rpmfileutil.c:26:0: ../include/rpm/rpmlog.h:225:6: note: expected 'const char *' but argument is of type 'int' void rpmlog (int code, const char *fmt, ...) RPM_GNUC_PRINTF(2, 3); ^ ... naturally giving the following during link-editing: Undefinedfirst referenced symbol in file _ rpmio/.libs/librpmio.so ld: fatal: symbol referencing errors. No output written to .libs/rpm2cpio collect2: error: ld returned 1 exit status Makefile:936: recipe for target 'rpm2cpio' failed gmake[2]: *** [rpm2cpio] Error 1 extract from configure'd system.h: /* Take care of NLS matters. */ #if ENABLE_NLS # include locale.h # include libintl.h # define _(Text) dgettext (PACKAGE, Text) #else # define _(Text) Text #endif #define N_(Text) Text ENABLE_NLS is defined, and the macro '_(Text)' seems to be ignored (turning off NLS changes nothing, as can be expected. I also tried building with CFLAGS+=-no-integrated-cpp to no avail. Is this a regression, or does gcc 4.8.x enforce new rules as to macro names? NB: This program builds fine with gcc 4.7.3. I'm building using pkgsrc with gcc configured as follows: $ /opt/local/gcc48/bin/gcc -v Using built-in specs. COLLECT_GCC=/opt/local/gcc48/bin/gcc COLLECT_LTO_WRAPPER=/opt/local/gcc48/libexec/gcc/x86_64-sun-solaris2.11/4.8.2/lto-wrapper Target: x86_64-sun-solaris2.11 Configured with: ../gcc-4.8.2/configure --enable-languages='c obj-c++ objc go fortran c++' --enable-shared --enable-long-long --with-local-prefix=/opt/local/gcc48 --enable-libssp --enable-threads=posix --with-boot-ldflags='-static-libstdc++ -static-libgcc -Wl,-R/opt/local/lib ' --disable-nls --with-cloog=/opt/local --enable-cloog-backend=isl --enable-__cxa_atexit --with-gxx-include-dir=/opt/local/gcc48/include/c++/ --with-gnu-as --with-as=/usr/gnu/bin/as --without-gnu-ld --with-ld=/usr/bin/ld --prefix=/opt/local/gcc48 --build=x86_64-sun-solaris2.11 --host=x86_64-sun-solaris2.11 --infodir=/opt/local/gcc48/info --mandir=/opt/local/gcc48/man Thread model: posix gcc version 4.8.2 (GCC)
[Bug preprocessor/60022] macro _(Text) generates warning: implicit declaration of function '_' [-Wimplicit-function-declaration]
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60022 --- Comment #1 from Andreas Schwab sch...@linux-m68k.org --- If the macro isn't defined then nothing defined it. Most likely rpmfileutil.c failed to include the right headers in the correct order.
[Bug preprocessor/60022] macro _(Text) generates warning: implicit declaration of function '_' [-Wimplicit-function-declaration]
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60022 Jakub Jelinek jakub at gcc dot gnu.org changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #2 from Jakub Jelinek jakub at gcc dot gnu.org --- You can preprocess with -E -dD and look at what exactly was defined where and how the preprocessed line containing call to rpmlog looks like.
[Bug target/60017] [4.7/4.8/4.9 Regression] Struct not returned correctly
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60017 Jakub Jelinek jakub at gcc dot gnu.org changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed||2014-02-01 CC||jakub at gcc dot gnu.org, ||uros at gcc dot gnu.org Target Milestone|--- |4.7.4 Summary|Struct not returned |[4.7/4.8/4.9 Regression] |correctly |Struct not returned ||correctly Ever confirmed|0 |1 --- Comment #1 from Jakub Jelinek jakub at gcc dot gnu.org --- Started with r142059.
[Bug preprocessor/60022] macro _(Text) generates warning: implicit declaration of function '_' [-Wimplicit-function-declaration]
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60022 --- Comment #3 from Richard PALO richard at netbsd dot org --- (In reply to Andreas Schwab from comment #1) If the macro isn't defined then nothing defined it. Most likely rpmfileutil.c failed to include the right headers in the correct order. The order is correct as #include system.h is first line.
[Bug preprocessor/60022] macro _(Text) generates warning: implicit declaration of function '_' [-Wimplicit-function-declaration]
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60022 --- Comment #4 from Richard PALO richard at netbsd dot org --- (In reply to Jakub Jelinek from comment #2) You can preprocess with -E -dD and look at what exactly was defined where and how the preprocessed line containing call to rpmlog looks like. Here are the relevant parts: == # 1 /usr/include/libintl.h 1 3 4 # 28 /usr/include/libintl.h 3 4 #define _LIBINTL_H #pragma ident %Z%%M% %I% %E% SMI # 53 /usr/include/libintl.h 3 4 #define _WCHAR_T typedef int wchar_t; #define TEXTDOMAINMAX 256 #define __GNU_GETTEXT_SUPPORTED_REVISION(m) m) == 0) || ((m) == 1)) ? 1 : -1) extern char *dcgettext(const char *, const char *, const int); extern char *dgettext(const char *, const char *); extern char *gettext(const char *); extern char *textdomain(const char *); extern char *bindtextdomain(const char *, const char *); and = # 37 /usr/include/locale.h 2 3 4 # 53 /usr/include/locale.h 3 4 #define _LastCategory LC_MESSAGES #define _ValidCategory(c) (((int)(c) = LC_CTYPE) ((int)(c) = _LastCategory) || ((int)c == LC_ALL)) # 132 ../system.h 2 #define _(Text) dgettext (PACKAGE, Text) #define N_(Text) Text = an extract from rpmfileio.c using the macro: if (tfd == NULL || Ferror(tfd)) { rpmlog(RPMLOG_ERR, _(error creating temporary file %s: %m\n), tempfn); goto exit;
[Bug preprocessor/60022] macro _(Text) generates warning: implicit declaration of function '_' [-Wimplicit-function-declaration]
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60022 --- Comment #5 from Richard PALO richard at netbsd dot org --- I should add, that for grins, I tried changing this invocation from '_()' to N_()' and the got over this one, but naturally blew on the next invocation later in the source code. Is this perhaps a const char* issue?
[Bug fortran/59997] c_pointer = c_loc(...) internal compiler error
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59997 janus at gcc dot gnu.org changed: What|Removed |Added Keywords||ice-on-valid-code CC||janus at gcc dot gnu.org --- Comment #1 from janus at gcc dot gnu.org --- I can confirm the ICE with 4.8 and earlier. However, it seems to be fixed on 4.9 trunk ...
[Bug preprocessor/60022] macro _(Text) generates warning: implicit declaration of function '_' [-Wimplicit-function-declaration]
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60022 --- Comment #6 from Jakub Jelinek jakub at gcc dot gnu.org --- Can you just attach the whole preprocessed rpmfileutil.i (with -E -dD) instead of copying in small snippets?
[Bug preprocessor/60022] macro _(Text) generates warning: implicit declaration of function '_' [-Wimplicit-function-declaration]
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60022 --- Comment #7 from Richard PALO richard at netbsd dot org --- Created attachment 32009 -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=32009action=edit output from -E -dD
[Bug preprocessor/60022] macro _(Text) generates warning: implicit declaration of function '_' [-Wimplicit-function-declaration]
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60022 --- Comment #8 from Richard PALO richard at netbsd dot org --- (In reply to Richard PALO from comment #7) Created attachment 32009 [details] output from -E -dD I'll see if I can make a concise test program to reproduce the issue.
[Bug preprocessor/60022] macro _(Text) generates warning: implicit declaration of function '_' [-Wimplicit-function-declaration]
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60022 Jakub Jelinek jakub at gcc dot gnu.org changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #9 from Jakub Jelinek jakub at gcc dot gnu.org --- No need for that, just look carefully at the output: ... # 132 ../system.h 2 #define _(Text) dgettext (PACKAGE, Text) ... # 46 /usr/include/libelf.h 3 4 #undef _ typedef void Elf_Void; #define _(a) a ... Elf_Data *elf64_xlatetom (Elf_Data *, const Elf_Data *, unsigned); #undef _ # 35 /usr/include/gelf.h 2 3 4 ... if (tfd == ((void *)0) || Ferror(tfd)) { rpmlog(RPMLOG_ERR, _(error creating temporary file %s: %m\n), tempfn); goto exit; } So, clearly your libelf.h is undefining _, then defining it and undefining it again at the end. So, I'd say your libelf.h is badly written, it shouldn't be really changing _, and perhaps if you want to compile rpm you need to reshuffle the headers so that libelf.h is included before headers that actually define _ macro. In any case, not a GCC bug.
[Bug other/56653] Warning when verifying checksums from MD5SUMS file in tarballs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56653 Gerald Pfeifer gerald at pfeifer dot com changed: What|Removed |Added Status|UNCONFIRMED |ASSIGNED Last reconfirmed||2014-02-01 CC||gerald at pfeifer dot com Ever confirmed|0 |1
[Bug other/56653] Warning when verifying checksums from MD5SUMS file in tarballs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56653 --- Comment #2 from gerald at gcc dot gnu.org gerald at gcc dot gnu.org --- Author: gerald Date: Sat Feb 1 12:01:56 2014 New Revision: 207387 URL: http://gcc.gnu.org/viewcvs?rev=207387root=gccview=rev Log: PR other/56653 * gcc_release: Avoid printing empty line to generated MD5SUMS files. Bump copyright year. Modified: trunk/maintainer-scripts/ChangeLog trunk/maintainer-scripts/gcc_release
[Bug preprocessor/60022] macro _(Text) generates warning: implicit declaration of function '_' [-Wimplicit-function-declaration]
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60022 --- Comment #10 from Richard PALO richard at netbsd dot org --- (In reply to Jakub Jelinek from comment #9) In any case, not a GCC bug. Great, is there an explanation as to why it works with gcc 4.7.3?
[Bug other/56653] Warning when verifying checksums from MD5SUMS file in tarballs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56653 Gerald Pfeifer gerald at pfeifer dot com changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|--- |FIXED Assignee|unassigned at gcc dot gnu.org |gerald at pfeifer dot com --- Comment #3 from Gerald Pfeifer gerald at pfeifer dot com --- Fixed.
[Bug other/56653] Warning when verifying checksums from MD5SUMS file in tarballs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56653 --- Comment #4 from gerald at gcc dot gnu.org gerald at gcc dot gnu.org --- Author: gerald Date: Sat Feb 1 12:28:18 2014 New Revision: 207388 URL: http://gcc.gnu.org/viewcvs?rev=207388root=gccview=rev Log: PR other/56653 * gcc_release: Avoid printing empty line to generated MD5SUMS files. Bump copyright year. Modified: branches/gcc-4_8-branch/ (props changed) branches/gcc-4_8-branch/maintainer-scripts/ChangeLog branches/gcc-4_8-branch/maintainer-scripts/gcc_release Propchange: branches/gcc-4_8-branch/ ('svn:mergeinfo' modified)
[Bug fortran/59906] [4.7/4.8/4.9 Regression] error: size of variable 'anonymous' is too large
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59906 --- Comment #8 from Paul Thomas pault at gcc dot gnu.org --- Created attachment 32010 -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=32010action=edit Tentative patch for the PR The line that compiled did not yield correct code. The testcase in the patch runs correctly. The first regtest failed in elemental_scalar_args_2.f90. To fix this, the exclusion of functions in the patched part of trans-expr.c had to be added. This surprises me because it looks to me as if gfc_conv_string_parameter should do the job itself. I will investigate. In the meantime, a second regtest is underway. Cheers Paul
[Bug rtl-optimization/60024] New: global-buffer-overflow in init_regs_for_mode
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60024 Bug ID: 60024 Summary: global-buffer-overflow in init_regs_for_mode Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: hjl.tools at gmail dot com When GCC is bootstrapped with --with-build-config=bootstrap-asan r207375 gave spawn -ignore SIGHUP /export/build/gnu/gcc-asan/build-x86_64-linux/gcc/testsuite/gfortran3/../../gfortran -B/export/build/gnu/gcc-asan/build-x86_64-linux/gcc/testsuite/gfortran3/../../ -B/export/build/gnu/gcc-asan/build-x86_64-linux/x86_64-unknown-linux-gnu/32/libgfortran/ /export/gnu/import/git/sources/gcc/gcc/testsuite/gfortran.dg/pr42294.f -fno-diagnostics-show-caret -fdiagnostics-color=never -O -O2 -fselective-scheduling2 -fsel-sched-pipelining -funroll-all-loops -S -m32 -o pr42294.s^M =^M ^[[1m^[[31m==9831==ERROR: AddressSanitizer: global-buffer-overflow on address 0x03deb6cd at pc 0x12f89cf bp 0x7ba71eb0 sp 0x7ba71ea8^M ^[[1m^[[0m^[[1m^[[34mREAD of size 1 at 0x03deb6cd thread T0^[[1m^[[0m^M #0 0x12f89ce in init_regs_for_mode /export/gnu/import/git/sources/gcc/gcc/sel-sched.c:1124^M #1 0x12f89ce in mark_unavailable_hard_regs /export/gnu/import/git/sources/gcc/gcc/sel-sched.c:1292^M #2 0x12f89ce in find_used_regs /export/gnu/import/git/sources/gcc/gcc/sel-sched.c:3336^M #3 0x12f89ce in collect_unavailable_regs_from_bnds /export/gnu/import/git/sources/gcc/gcc/sel-sched.c:1630^M #4 0x12f89ce in find_best_reg_for_expr /export/gnu/import/git/sources/gcc/gcc/sel-sched.c:1693^M #5 0x12f89ce in fill_vec_av_set /export/gnu/import/git/sources/gcc/gcc/sel-sched.c:3853^M #6 0x12ff673 in fill_ready_list /export/gnu/import/git/sources/gcc/gcc/sel-sched.c:4083^M #7 0x12ff673 in find_best_expr /export/gnu/import/git/sources/gcc/gcc/sel-sched.c:4446^M #8 0x12ff673 in fill_insns /export/gnu/import/git/sources/gcc/gcc/sel-sched.c:5613^M #9 0x12ff673 in schedule_on_fences /export/gnu/import/git/sources/gcc/gcc/sel-sched.c:7434^M #10 0x12ff673 in sel_sched_region_2 /export/gnu/import/git/sources/gcc/gcc/sel-sched.c:7568^M #11 0x130bb8e in sel_sched_region_1 /export/gnu/import/git/sources/gcc/gcc/sel-sched.c:7607^M #12 0x130bb8e in sel_sched_region(int) /export/gnu/import/git/sources/gcc/gcc/sel-sched.c:7708^M #13 0x130f731 in run_selective_scheduling() /export/gnu/import/git/sources/gcc/gcc/sel-sched.c:7784^M #14 0x12a5cb1 in rest_of_handle_sched2 /export/gnu/import/git/sources/gcc/gcc/sched-rgn.c:3650^M #15 0x12a5cb1 in execute /export/gnu/import/git/sources/gcc/gcc/sched-rgn.c:3769^M #16 0x11768e4 in execute_one_pass(opt_pass*) /export/gnu/import/git/sources/gcc/gcc/passes.c:2229^M #17 0x11772c8 in execute_pass_list(opt_pass*) /export/gnu/import/git/sources/gcc/gcc/passes.c:2282^M #18 0x11772ee in execute_pass_list(opt_pass*) /export/gnu/import/git/sources/gcc/gcc/passes.c:2283^M #19 0x11772ee in execute_pass_list(opt_pass*) /export/gnu/import/git/sources/gcc/gcc/passes.c:2283^M #20 0xa71cfa in expand_function /export/gnu/import/git/sources/gcc/gcc/cgraphunit.c:1774^M #21 0xa770da in expand_all_functions /export/gnu/import/git/sources/gcc/gcc/cgraphunit.c:1908^M #22 0xa770da in compile() /export/gnu/import/git/sources/gcc/gcc/cgraphunit.c:2252^M #23 0xa7898a in finalize_compilation_unit() /export/gnu/import/git/sources/gcc/gcc/cgraphunit.c:2329^M #24 0xffd1e0 in write_global_declarations() /export/gnu/import/git/sources/gcc/gcc/langhooks.c:323^M #25 0x1367834 in compile_file /export/gnu/import/git/sources/gcc/gcc/toplev.c:562^M #26 0x136c7a3 in do_compile /export/gnu/import/git/sources/gcc/gcc/toplev.c:1914^M #27 0x136c7a3 in toplev_main(int, char**) /export/gnu/import/git/sources/gcc/gcc/toplev.c:1990^M #28 0x3743821ca4 in __libc_start_main (/lib64/libc.so.6+0x3743821ca4)^M #29 0x5d1e60 (/export/build/gnu/gcc-asan/build-x86_64-linux/gcc/f951+0x5d1e60)^M ^M ^[[1m^[[32m0x03deb6cd is located 51 bytes to the left of global variable 'default_target_regs' from '/export/gnu/import/git/sources/gcc/gcc/reginfo.c' (0x3deb700) of size 20488^M ^[[1m^[[0m^[[1m^[[32m0x03deb6cd is located 0 bytes to the right of global variable 'global_regs' from '/export/gnu/import/git/sources/gcc/gcc/reginfo.c' (0x3deb680) of size 77^M
[Bug c++/60019] [C++11] Bogus error: use of deleted function unique_ptr(const unique_ptr)
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60019 Daniel Krügler daniel.kruegler at googlemail dot com changed: What|Removed |Added CC||daniel.kruegler@googlemail. ||com --- Comment #1 from Daniel Krügler daniel.kruegler at googlemail dot com --- I don't think that this is related to the implementation of unique_ptr, instead my guess is that gcc currently does not yet implement http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#5 The code compiles well, if the destination object is not a const object or if the initialization is direct-initialization. Before CWG 5 was reolved, it was unclear whether the wording in 8.5 p17 (The bullet starting with: If the destination type is a (possibly cv-qualified) class type) was referring to a destination type including or without it's cv qualification. More evidence to that assumption is that the CWG 5 code example is currently rejected by gcc as it would be expected to happen according to the including the cv-qualifier interpretation.
[Bug rtl-optimization/60024] global-buffer-overflow in init_regs_for_mode
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60024 H.J. Lu hjl.tools at gmail dot com changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed||2014-02-01 CC||abel at ispras dot ru Target Milestone|--- |4.9.0 Ever confirmed|0 |1 --- Comment #1 from H.J. Lu hjl.tools at gmail dot com --- (In reply to H.J. Lu from comment #0) When GCC is bootstrapped with --with-build-config=bootstrap-asan r207375 gave spawn -ignore SIGHUP /export/build/gnu/gcc-asan/build-x86_64-linux/gcc/testsuite/gfortran3/../../ gfortran -B/export/build/gnu/gcc-asan/build-x86_64-linux/gcc/testsuite/gfortran3/../.. / -B/export/build/gnu/gcc-asan/build-x86_64-linux/x86_64-unknown-linux-gnu/32/ libgfortran/ /export/gnu/import/git/sources/gcc/gcc/testsuite/gfortran.dg/pr42294.f -fno-diagnostics-show-caret -fdiagnostics-color=never -O -O2 -fselective-scheduling2 -fsel-sched-pipelining -funroll-all-loops -S -m32 -o pr42294.s^M =^M ^[[1m^[[31m==9831==ERROR: AddressSanitizer: global-buffer-overflow on address 0x03deb6cd at pc 0x12f89cf bp 0x7ba71eb0 sp 0x7ba71ea8^M ^[[1m^[[0m^[[1m^[[34mREAD of size 1 at 0x03deb6cd thread T0^[[1m^[[0m^M #0 0x12f89ce in init_regs_for_mode /export/gnu/import/git/sources/gcc/gcc/sel-sched.c:1124^M (gdb) call ix86_hard_regno_mode_ok (cur_reg, mode) $6 = false (gdb) p cur_reg $7 = 76 (gdb) p mode $8 = DFmode (gdb) p nregs $9 = 2 (gdb) call ix86_hard_regno_mode_ok (cur_reg, mode) $10 = false (gdb)
[Bug tree-optimization/60023] [4.9 Regression] ICE: verify_gimple failed: dead STMT in EH table with -O3 -fnon-call-exceptions -mavx2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60023 H.J. Lu hjl.tools at gmail dot com changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed||2014-02-01 CC||hjl.tools at gmail dot com, ||jakub at gcc dot gnu.org, ||kirill.yukhin at intel dot com Target Milestone|--- |4.9.0 Ever confirmed|0 |1 --- Comment #1 from H.J. Lu hjl.tools at gmail dot com --- It is caused by r205856.
[Bug middle-end/60013] [4.9 Regression] Build of 176.gcc from CPU2000 loops in cc1 starting with r207231
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60013 --- Comment #2 from H.J. Lu hjl.tools at gmail dot com --- Still unfixed with r207387.
[Bug c++/60025] New: Static member of class not found if class name == namespace name it's defined in
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60025 Bug ID: 60025 Summary: Static member of class not found if class name == namespace name it's defined in Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ppilar11 at gmail dot com Consider this definition: namespace Foo { int x; class Foo { public: static int x; }; int Foo::x; } and test code in which it's used: int main() { using namespace Foo; Foo::x; return 0; } Both gcc 4.7.2 and gcc 4.8.1 accept the above code even though Foo::x is ambiguous: could be either a global variable in namespace Foo or static member of class Foo. Visual C++ 2013 rejects the code with error C2872: 'Foo' : ambiguous symbol could be 'Foo' or 'Foo::Foo', gcc simply resolves Foo::x to global variable x. If I comment out the global variable x from namespace definition then both gcc 4.7.2 and gcc 4.8.1 reject the code with error: 'x' is not a member of 'Foo', so they fail to find the static member of class Foo unless I qualify it as Foo::Foo::x (which should not be necessary due to using directive).
[Bug middle-end/60013] [4.9 Regression] Build of 176.gcc from CPU2000 loops in cc1 starting with r207231
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60013 H.J. Lu hjl.tools at gmail dot com changed: What|Removed |Added Attachment #32006|0 |1 is obsolete|| --- Comment #3 from H.J. Lu hjl.tools at gmail dot com --- Created attachment 32011 -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=32011action=edit A smaller testcase It hangs at -O2 on Linux/x86-64.
[Bug libstdc++/57350] std::align missing
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57350 Vladimir Krivopalov vladimir.krivopalov at gmail dot com changed: What|Removed |Added CC||vladimir.krivopalov at gmail dot c ||om --- Comment #3 from Vladimir Krivopalov vladimir.krivopalov at gmail dot com --- Greetings, Any chance to get std::align() implementation included in the coming GCC releases? What needs to be done for that?
[Bug middle-end/60013] [4.9 Regression] Build of 176.gcc from CPU2000 loops in cc1 starting with r207231
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60013 Jakub Jelinek jakub at gcc dot gnu.org changed: What|Removed |Added CC||hubicka at gcc dot gnu.org --- Comment #4 from Jakub Jelinek jakub at gcc dot gnu.org --- Seems it is oscillating, but I don't see anything wrong from quick look at the IL. So, if the algorithm doesn't have guaranteed termination, it should just have some maximum number of iteration and give up if it doesn't terminate till then.
[Bug middle-end/60013] [4.9 Regression] Build of 176.gcc from CPU2000 loops in cc1 starting with r207231
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60013 --- Comment #5 from H.J. Lu hjl.tools at gmail dot com --- This in compute_bb_predicates while (!done) { done = true; FOR_EACH_BB_FN (bb, my_function) { struct predicate p = false_predicate (); edge e; edge_iterator ei; FOR_EACH_EDGE (e, ei, bb-preds) { if (e-src-aux) { struct predicate this_bb_predicate = *(struct predicate *) e-src-aux; if (e-aux) this_bb_predicate = and_predicates (summary-conds, this_bb_predicate, (struct predicate *) e-aux); p = or_predicates (summary-conds, p, this_bb_predicate); if (true_predicate_p (p)) break; } } if (false_predicate_p (p)) gcc_assert (!bb-aux); else { if (!bb-aux) { done = false; Set to false on (gdb) call debug_bb (bb) bb 13: ABNORMAL_DISPATCHER (0); Should it call get_abnormal_succ_dispatcher to check here? bb-aux = pool_alloc (edge_predicate_pool); *((struct predicate *) bb-aux) = p; } else if (!predicates_equal_p (p, (struct predicate *) bb-aux)) { done = false; *((struct predicate *) bb-aux) = p; } } } } goes into an infinite loop.
[Bug middle-end/60013] [4.9 Regression] Build of 176.gcc from CPU2000 loops in cc1 starting with r207231
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60013 --- Comment #6 from H.J. Lu hjl.tools at gmail dot com --- Like this: diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c index 9a4c6df..991a10b 100644 --- a/gcc/ipa-inline-analysis.c +++ b/gcc/ipa-inline-analysis.c @@ -1881,9 +1881,12 @@ compute_bb_predicates (struct cgraph_node *node, { if (!bb-aux) { - done = false; - bb-aux = pool_alloc (edge_predicate_pool); - *((struct predicate *) bb-aux) = p; + if (!get_abnormal_succ_dispatcher (bb)) +{ + done = false; + bb-aux = pool_alloc (edge_predicate_pool); + *((struct predicate *) bb-aux) = p; +} } else if (!predicates_equal_p (p, (struct predicate *) bb-aux)) {
[Bug middle-end/60013] [4.9 Regression] Build of 176.gcc from CPU2000 loops in cc1 starting with r207231
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60013 H.J. Lu hjl.tools at gmail dot com changed: What|Removed |Added Attachment #32011|0 |1 is obsolete|| --- Comment #7 from H.J. Lu hjl.tools at gmail dot com --- Created attachment 32012 -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=32012action=edit Even smaller testcase
[Bug c/59850] Support sparse-style pointer address spaces (type attributes)
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59850 --- Comment #4 from Josh Triplett josh at joshtriplett dot org --- (In reply to Tom Tromey from comment #3) I noticed this behavior and was wondering if it is intended: bapiya. cat /tmp/q.c __attribute__((force)) int *p; int q = *p; bapiya. sparse -Wno-decl /tmp/q.c /tmp/q.c:2:10: warning: dereference of noderef expression If so it would be good to know all the rules for force -- I stumbled across this by accident but then was wondering if there are other rules I don't know of. What version of sparse did you try that with? I can't seem to reproduce that with the current version, nor with older versions.
[Bug tree-optimization/59100] requesting optimization of safe rotate function
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59100 Marc Glisse glisse at gcc dot gnu.org changed: What|Removed |Added CC||glisse at gcc dot gnu.org --- Comment #4 from Marc Glisse glisse at gcc dot gnu.org --- Created attachment 32013 -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=32013action=edit phiopt patch Needs more comments and a testcase, but this passes regtesting and seems to work. For next stage 1...
[Bug fortran/59906] [4.7/4.8/4.9 Regression] error: size of variable 'anonymous' is too large
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59906 --- Comment #9 from Paul Thomas pault at gcc dot gnu.org --- Author: pault Date: Sat Feb 1 18:50:41 2014 New Revision: 207389 URL: http://gcc.gnu.org/viewcvs?rev=207389root=gccview=rev Log: 2014-02-01 Paul Thomas pa...@gcc.gnu.org PR fortran/59906 * trans-stmt.c (gfc_add_loop_ss_code): In the case of character SS_REFERENCE, use gfc_conv_string_parameter to ensure that a pointer to the string is stored. * trans-expr.c (gfc_conv_expr_reference): Likewise, use gfc_conv_string_parameter to ensure that a pointer to is passed to the elemental function. 2014-02-01 Paul Thomas pa...@gcc.gnu.org PR fortran/59906 * gfortran.dg/elemental_subroutine_9.f90 : New test Added: trunk/gcc/testsuite/gfortran.dg/elemental_subroutine_9.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/trans-array.c trunk/gcc/fortran/trans-expr.c trunk/gcc/testsuite/ChangeLog
[Bug middle-end/60013] [4.9 Regression] Build of 176.gcc from CPU2000 loops in cc1 starting with r207231
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60013 --- Comment #8 from Jakub Jelinek jakub at gcc dot gnu.org --- That doesn't look correct, that will not clear done on any basic block that has abnormal successor with ABNORMAL_DISPATCHER, which is a lot of basic blocks. If the algorithm isn't supposed to follow abnormal edges, then it shouldn't follow them, not have some hack for the abnormal dispatcher.
[Bug middle-end/60004] Conditional return within transaction causes ICE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60004 --- Comment #6 from Mike Spear spear at cse dot lehigh.edu --- (For the record, this bug was found by wcm...@lehigh.edu, even though I reported it)
[Bug fortran/59414] [4.8 Regression] [OOP] ICE in in gfc_conv_expr_descriptor on ALLOCATE inside SELECT TYPE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59414 --- Comment #18 from Paul Thomas pault at gcc dot gnu.org --- Author: pault Date: Sat Feb 1 22:31:53 2014 New Revision: 207390 URL: http://gcc.gnu.org/viewcvs?rev=207390root=gccview=rev Log: 2014-02-01 Paul Thomas pa...@gcc.gnu.org PR fortran/59414 * trans-stmt.c (gfc_trans_allocate): Before the pointer assignment to transfer the source _vptr to a class allocate expression, the final class reference should be exposed. The tail that includes the _data and array references is stored. This reduced expression is transferred to 'lhs' and the _vptr added. Then the tail is restored to the allocate expression. 2014-02-01 Paul Thomas pa...@gcc.gnu.org PR fortran/59414 * gfortran.dg/allocate_class_3.f90 : New test Added: branches/gcc-4_8-branch/gcc/testsuite/gfortran.dg/allocate_class_3.f90 Modified: branches/gcc-4_8-branch/gcc/fortran/ChangeLog branches/gcc-4_8-branch/gcc/fortran/trans-stmt.c branches/gcc-4_8-branch/gcc/testsuite/ChangeLog
[Bug fortran/59414] [4.8 Regression] [OOP] ICE in in gfc_conv_expr_descriptor on ALLOCATE inside SELECT TYPE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59414 Paul Thomas pault at gcc dot gnu.org changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #19 from Paul Thomas pault at gcc dot gnu.org --- Thanks for the report - fixed on 4.8 and 4.9 Paul
[Bug tree-optimization/60026] New: ICE at -O3 on valid code (with the optimize pragma) on x86_64-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60026 Bug ID: 60026 Summary: ICE at -O3 on valid code (with the optimize pragma) on x86_64-linux-gnu Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: su at cs dot ucdavis.edu The following code using the optimize pragma causes an ICE when compiled with the current gcc trunk and 4.8.x at -O3 on x86_64-linux-gnu (in both 32-bit and 64-bit modes). It is a regression from 4.7.x. $ gcc-trunk -v Using built-in specs. COLLECT_GCC=gcc-trunk COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../gcc-trunk/configure --prefix=/usr/local/gcc-trunk --enable-languages=c,c++ --disable-werror --enable-multilib Thread model: posix gcc version 4.9.0 20140131 (experimental) [trunk revision 207368] (GCC) $ $ gcc-trunk -O2 small.c; a.out $ gcc-4.7.3 -O3 small.c; a.out $ $ gcc-trunk -O3 small.c small.c: In function ‘foo.constprop’: small.c:8:10: internal compiler error: in parm_preserved_before_stmt_p, at ipa-prop.c:760 struct S foo (int p1, struct S p2) ^ 0x84d137 parm_preserved_before_stmt_p ../../gcc-trunk/gcc/ipa-prop.c:760 0x84ecb4 ipa_load_from_parm_agg_1 ../../gcc-trunk/gcc/ipa-prop.c:885 0x8531fa ipcp_transform_function(cgraph_node*) ../../gcc-trunk/gcc/ipa-prop.c:4776 0x915260 execute_one_ipa_transform_pass ../../gcc-trunk/gcc/passes.c:2066 0x915260 execute_all_ipa_transforms() ../../gcc-trunk/gcc/passes.c:2107 0x6a022a expand_function ../../gcc-trunk/gcc/cgraphunit.c:1767 0x6a2116 expand_all_functions ../../gcc-trunk/gcc/cgraphunit.c:1908 0x6a2116 compile() ../../gcc-trunk/gcc/cgraphunit.c:2252 0x6a2994 finalize_compilation_unit() ../../gcc-trunk/gcc/cgraphunit.c:2329 0x55c5e2 c_write_global_declarations() ../../gcc-trunk/gcc/c/c-decl.c:10401 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See http://gcc.gnu.org/bugs.html for instructions. $ -- struct S { int f; } a; #pragma GCC push_options #pragma GCC optimize (-O0) struct S foo (int p1, struct S p2) { int b = p2.f; return a; } #pragma GCC pop_options void bar () { for (;a.f;) { struct S c = {0}; foo (0, c); } } int main () { bar(); return 0; }
[Bug libstdc++/57350] std::align missing
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57350 --- Comment #4 from David Krauss potswa at mac dot com --- Hmm, I recall preparing to submit a patch but not being able to decide which header to modify. Here's the aforementioned MIT-licensed code. The MIT license only requires attribution which is satisfied by the changelog; anyway I don't care. I am already a GNU contributor with FSF waiver back in 2009. This code should probably be reviewed. I wrote it a long time ago and seldom used it. Cannot recall whether it was intended to be 100% compliant. inline void *align( std::size_t alignment, std::size_t size, void *ptr, std::size_t space ) { auto pn = reinterpret_cast std::size_t ( ptr ); auto aligned = ( pn + alignment - 1 ) - alignment; auto new_space = space - ( aligned - pn ); if ( new_space size ) return nullptr; space = new_space; return ptr = reinterpret_cast void * ( aligned ); }
[Bug libstdc++/57350] std::align missing
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57350 --- Comment #5 from David Krauss potswa at mac dot com --- Just re-reading now, std::size_t should be std::uintptr_t, but I don't see anything else that could cause UB. The bitwise negative arithmetic should be OK because it's all on unsigned values. And if GNU style doesn't allow auto, those should just be uintptr_t or size_t as appropriate.
[Bug libstdc++/57350] std::align missing
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57350 --- Comment #6 from Vladimir Krivopalov vladimir.krivopalov at gmail dot com --- (In reply to David Krauss from comment #5) Just re-reading now, std::size_t should be std::uintptr_t, but I don't see anything else that could cause UB. The bitwise negative arithmetic should be OK because it's all on unsigned values. And if GNU style doesn't allow auto, those should just be uintptr_t or size_t as appropriate. This code looks fine to me at my best knowledge of expected std::align() behaviour. I also tried it against the artificial test case described at https://stackoverflow.com/questions/16305311/usage-issue-of-stdalign and it doesn't re-align the already aligned pointer. Not sure if auto keyword is prohibited by GCC internal code style, perhaps someone from GCC devs could help on that. Thank you for preparing the fix, David!
[Bug libstdc++/57350] std::align missing
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57350 --- Comment #7 from David Krauss potswa at mac dot com --- Haha, it looks like the MSVC devs forgot to subtract 1. Typical. I did test my code in a real arena allocator, by the way, so that sort of thing would not have gotten through.