[Bug bootstrap/82037] powerpc64-unknown-linux-gnu bootstrap breaks in stage2 with gcc/liblto_plugin.so: wrong ELF class: ELFCLASS64

2017-08-31 Thread dclarke at blastwave dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82037

--- Comment #6 from Dennis Clarke  ---
Well that change fails in stage 1 : 

/usr/local/build/gcc-7.2.0_linux_3.16.0-4-powerpc64.003/./gcc/xgcc
-B/usr/local/build/gcc-7.2.0_linux_3.16.0-4-powerpc64.003/./gcc/
-B/usr/local/gcc7/powerpc64-unknown-linux-gnu/bin/
-B/usr/local/gcc7/powerpc64-unknown-linux-gnu/lib/ -isystem
/usr/local/gcc7/powerpc64-unknown-linux-gnu/include -isystem
/usr/local/gcc7/powerpc64-unknown-linux-gnu/sys-include-O2  -g -O2 -DIN_GCC
   -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format
-Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem
./include   -fPIC -mlong-double-128 -mno-minimal-toc -g -DIN_LIBGCC2
-fbuilding-libgcc -fno-stack-protector  -shared -nodefaultlibs
-Wl,--soname=libgcc_s.so.1 -Wl,--version-script=libgcc.map -o
64/libgcc_s.so.1.tmp -g -O2 -m64 -B./ _muldi3_s.o _negdi2_s.o _lshrdi3_s.o
_ashldi3_s.o _ashrdi3_s.o _cmpdi2_s.o _ucmpdi2_s.o _clear_cache_s.o
_trampoline_s.o __main_s.o _absvsi2_s.o _absvdi2_s.o _addvsi3_s.o _addvdi3_s.o
_subvsi3_s.o _subvdi3_s.o _mulvsi3_s.o _mulvdi3_s.o _negvsi2_s.o _negvdi2_s.o
_ctors_s.o _ffssi2_s.o _ffsdi2_s.o _clz_s.o _clzsi2_s.o _clzdi2_s.o _ctzsi2_s.o
_ctzdi2_s.o _popcount_tab_s.o _popcountsi2_s.o _popcountdi2_s.o _paritysi2_s.o
_paritydi2_s.o _powisf2_s.o _powidf2_s.o _powixf2_s.o _powitf2_s.o _mulhc3_s.o
_mulsc3_s.o _muldc3_s.o _mulxc3_s.o _multc3_s.o _divhc3_s.o _divsc3_s.o
_divdc3_s.o _divxc3_s.o _divtc3_s.o _bswapsi2_s.o _bswapdi2_s.o _clrsbsi2_s.o
_clrsbdi2_s.o _fixunssfsi_s.o _fixunsdfsi_s.o _fixunsxfsi_s.o _fixsfdi_s.o
_fixdfdi_s.o _fixxfdi_s.o _fixtfdi_s.o _fixunssfdi_s.o _fixunsdfdi_s.o
_fixunsxfdi_s.o _fixunstfdi_s.o _floatdisf_s.o _floatdidf_s.o _floatdixf_s.o
_floatditf_s.o _floatundisf_s.o _floatundidf_s.o _floatundixf_s.o
_floatunditf_s.o _divdi3_s.o _moddi3_s.o _divmoddi4_s.o _udivdi3_s.o
_umoddi3_s.o _udivmoddi4_s.o _udiv_w_sdiv_s.o ibm-ldouble_s.o tramp_s.o
ppc64-fp_s.o enable-execute-stack_s.o unwind-dw2_s.o unwind-dw2-fde-dip_s.o
unwind-sjlj_s.o unwind-c_s.o emutls_s.o libgcc.a -lc && rm -f 64/libgcc_s.so &&
if [ -f 64/libgcc_s.so.1 ]; then mv -f 64/libgcc_s.so.1
64/libgcc_s.so.1.backup; else true; fi && mv 64/libgcc_s.so.1.tmp
64/libgcc_s.so.1 && (echo "/* GNU ld script"; echo "   Use the shared library,
but some functions are only in"; echo "   the static library.  */"; echo "GROUP
( libgcc_s.so.1 -lgcc )" ) > 64/libgcc_s.so
/usr/bin/ld:
/usr/local/build/gcc-7.2.0_linux_3.16.0-4-powerpc64.003/./gcc/liblto_plugin.so:
error loading plugin:
/usr/local/build/gcc-7.2.0_linux_3.16.0-4-powerpc64.003/./gcc/liblto_plugin.so:
wrong ELF class: ELFCLASS64
collect2: error: ld returned 1 exit status
gmake[5]: *** [libgcc_s.so] Error 1
gmake[5]: Leaving directory
`/usr/local/build/gcc-7.2.0_linux_3.16.0-4-powerpc64.003/powerpc64-unknown-linux-gnu/64/libgcc'
gmake[4]: *** [multi-do] Error 1
gmake[4]: Leaving directory
`/usr/local/build/gcc-7.2.0_linux_3.16.0-4-powerpc64.003/powerpc64-unknown-linux-gnu/libgcc'
gmake[3]: *** [all-multi] Error 2
gmake[3]: Leaving directory
`/usr/local/build/gcc-7.2.0_linux_3.16.0-4-powerpc64.003/powerpc64-unknown-linux-gnu/libgcc'
gmake[2]: *** [all-stage1-target-libgcc] Error 2
gmake[2]: Leaving directory
`/usr/local/build/gcc-7.2.0_linux_3.16.0-4-powerpc64.003'
gmake[1]: *** [stage1-bubble] Error 2
gmake[1]: Leaving directory
`/usr/local/build/gcc-7.2.0_linux_3.16.0-4-powerpc64.003'
gmake: *** [bootstrap] Error 2
Command exited with non-zero status 2

[Bug c++/81932] Template arguments of type unsigned generate incorrect debugging information

2017-08-31 Thread psmith at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81932

--- Comment #25 from Paul Smith  ---
> (1) Find the mangled name of the vtable of tv.
> (2) Demangle the name, to be 'vtable for TreeVector::Tree'.
> (3) Skip 'vtable for ' and get 'TreeVector::Tree'.
> (4) Lookup this symbol.

Right, and this is my concern: how many different types of symbol modifications
are we going to expect GDB to attempt?  Massaging this type to all its
different equivalent types and then attempting to look them up seems pretty
inefficient.  I'm not familiar at all with the implementation but I'm not sure
I see why we can't just ensure that the symbol values provided match
identically to the de-mangled names, so we always know that we can demangle the
name then look up the symbol.

I also filed a bug against GDB (mentioned above) which is similar: in that case
the demangled name contained the default value for a defaulted template
argument, but the actual symbol provided didn't contain that default: again the
lookup didn't match.  How can GDB know that this argument is the default and it
should try removing that argument and looking up the symbol without it?

[Bug c/82068] New: wrong double to uint64_t conversion with -mieee

2017-08-31 Thread coypu at sdf dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82068

Bug ID: 82068
   Summary: wrong double to uint64_t conversion with -mieee
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: coypu at sdf dot org
  Target Milestone: ---

background:
gcc 8.0.0 20170827
netbsd-8.99.2/alpha, 21264

the following test case asserts if built with -mieee, but not without:

#include 
#include 
#include 

int
main (void)
{
long double even = 9223372036854775808.00; /* 2^63 */
uint64_t unsigned_even = even;

assert(unsigned_even % 2 == 0);

return 0;
}

[Bug target/81874] internal compiler error: in do_SUBST, at combine.c:725

2017-08-31 Thread paul.hua.gm at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81874

Paul Hua  changed:

   What|Removed |Added

 CC||paul.hua.gm at gmail dot com

--- Comment #3 from Paul Hua  ---
It hides or fixed whit r251397 on trunk.

[Bug bootstrap/82037] powerpc64-unknown-linux-gnu bootstrap breaks in stage2 with gcc/liblto_plugin.so: wrong ELF class: ELFCLASS64

2017-08-31 Thread dclarke at blastwave dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82037

--- Comment #5 from Dennis Clarke  ---
ppc64$ pwd
/usr/local/build/gcc-7.2.0_linux_3.16.0-4-powerpc64.003

ppc64$ date 
Fri Sep  1 03:01:16 GMT 2017

ppc64$ ../gcc-7.2.0/configure --build=powerpc64-unknown-linux-gnu \
> --target=powerpc64-unknown-linux-gnu --host=powerpc64-unknown-linux-gnu \
> --enable-targets=powerpc-linux,powerpc64-linux --prefix=/usr/local/gcc7 \
> --disable-nls --enable-threads=posix --enable-shared \
> --with-cpu=default32 --enable-bootstrap \
> --enable-libstdcxx-debug --enable-libstdcxx-time=yes \
> --enable-__cxa_atexit --with-system-zlib --enable-objc-gc \
> --enable-multiarch --with-long-double-128 --enable-multilib \
> --enable-stage1-languages=c,c++ --enable-stage1-checking=misc \
> --enable-languages=ada,c,c++,fortran,go,lto,objc,obj-c++ \
> --with-pkgversion='genunix Fri Sep  1 03:01:16 GMT 2017' 
checking build system type... powerpc64-unknown-linux-gnu
checking host system type... powerpc64-unknown-linux-gnu
checking target system type... powerpc64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /bin/sed
checking for gawk... no
checking for mawk... mawk
checking for libatomic support... yes
checking for libcilkrts support... no
checking for libitm support... yes
checking for libsanitizer support... yes
checking for libvtv support... no
checking for libmpx support... no
checking for libhsail-rt support... no
checking for powerpc64-unknown-linux-gnu-gcc... gcc -m64
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -m64 accepts -g... yes
checking for gcc -m64 option to accept ISO C89... none needed
checking whether we are using the GNU C++ compiler... yes
checking whether g++ -m64 accepts -g... yes
checking whether g++ accepts -static-libstdc++ -static-libgcc... yes
checking for powerpc64-unknown-linux-gnu-gnatbind... no
checking for gnatbind... gnatbind
checking for powerpc64-unknown-linux-gnu-gnatmake... no
checking for gnatmake... gnatmake
checking whether compiler driver understands Ada... yes
checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1
$$f2
checking for objdir... .libs
configure: WARNING: using in-tree isl, disabling version check
The following languages will be built: c,ada,c++,fortran,go,lto,objc,obj-c++
checking for bdw garbage collector... using bdw-gc in default locations
*** This configuration is not supported in the following subdirectories:
 zlib target-libcilkrts target-libvtv target-libmpx target-libhsail-rt
target-liboffloadmic
(Any other directories should still work fine.)
checking for default BUILD_CONFIG... bootstrap-debug
checking for --enable-vtable-verify... no
checking for bison... bison -y
checking for bison... bison
checking for gm4... no
checking for gnum4... no
checking for m4... m4
checking for flex... flex
checking for flex... flex
checking for makeinfo... makeinfo
checking for expect... expect
checking for runtest... runtest
checking for powerpc64-unknown-linux-gnu-ar... no
checking for ar... ar
checking for powerpc64-unknown-linux-gnu-as... no
checking for as... as
checking for powerpc64-unknown-linux-gnu-dlltool... no
checking for dlltool... no
checking for powerpc64-unknown-linux-gnu-ld... no
checking for ld... ld
checking for powerpc64-unknown-linux-gnu-lipo... no
checking for lipo... no
checking for powerpc64-unknown-linux-gnu-nm... no
checking for nm... nm
checking for powerpc64-unknown-linux-gnu-ranlib... no
checking for ranlib... ranlib
checking for powerpc64-unknown-linux-gnu-strip... no
checking for strip... strip
checking for powerpc64-unknown-linux-gnu-windres... no
checking for windres... no
checking for powerpc64-unknown-linux-gnu-windmc... no
checking for windmc... no
checking for powerpc64-unknown-linux-gnu-objcopy... no
checking for objcopy... objcopy
checking for powerpc64-unknown-linux-gnu-objdump... no
checking for objdump... objdump
checking for powerpc64-unknown-linux-gnu-readelf... no
checking for readelf... readelf
checking for powerpc64-unknown-linux-gnu-cc... no
checking for cc... cc
checking for powerpc64-unknown-linux-gnu-c++... no
checking for c++... c++
checking for powerpc64-unknown-linux-gnu-gcc... no
checking for gcc... gcc
checking for powerpc64-unknown-linux-gnu-gfortran... no
checking for gfortran... gfortran
checking for powerpc64-unknown-linux-gnu-gccgo... no
checking for gccgo... no
checking for ar... no
checking for powerpc64-unknown-linux-gnu-ar... no
checking for ar... ar
checking for as... no
checking for powerpc64-unknown-linux-gnu-as... no
checking for as... as
checking for dlltool... no
checking for 

[Bug c++/82067] New: G++ has an internal compiler error in possible_polymorphic_call_targets, at ipa-devirt.c:1557

2017-08-31 Thread jupitercuso4 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82067

Bug ID: 82067
   Summary: G++ has an internal compiler error in
possible_polymorphic_call_targets, at
ipa-devirt.c:1557
   Product: gcc
   Version: 4.9.4
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jupitercuso4 at gmail dot com
  Target Milestone: ---

Applied patch from PR60871 but it still fails:

$ gcc -v
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/project/usr-tensilica-RHEL5/stools-8.0-2017-06-05/bin/../libexec/gcc/x86_64-pc-linux-gnu/4.9.4/lto-wrapper
Target: x86_64-pc-linux-gnu
../gcc-4.9.4/configure --with-checking=release --build=x86_64-pc-linux-gnu
-enable-languages=c,c++ --disable-libgcj --prefix=/usr/bin

$  g++ -c -O2 -g -MD -Werror -Wno-unused-value -fPIC  -Wall -Werror -O3
-fomit-frame-pointer -std=gnu++0x -Wno-non-virtual-dtor -Wno-write-strings
-Wno-deprecated -Wno-parentheses -Wno-delete-non-virtual-dtor -Wno-parentheses
-Wno-unused-variable test.cpp

test.cpp:32:1: internal compiler error: in possible_polymorphic_call_targets,
at ipa-devirt.c:1557

0x6828cb possible_polymorphic_call_targets(tree_node*, long,
ipa_polymorphic_call_context, bool*, void**, int*)
../../gcc-4.9.4/gcc/ipa-devirt.c:1557
0x665cea possible_polymorphic_call_targets(tree_node*, bool*, void**)
../../gcc-4.9.4/gcc/ipa-utils.h:142
0xc87198 gimple_fold_call
../../gcc-4.9.4/gcc/gimple-fold.c:1127
0xc87198 fold_stmt_1
../../gcc-4.9.4/gcc/gimple-fold.c:1302
0xd909b8 fold_marked_statements
../../gcc-4.9.4/gcc/tree-inline.c:4549
0xd8c2e0 optimize_inline_calls(tree_node*)
../../gcc-4.9.4/gcc/tree-inline.c:4630
0xf48b89 inline_transform(cgraph_node*)
../../gcc-4.9.4/gcc/ipa-inline-transform.c:457
0xd1b58a execute_one_ipa_transform_pass
../../gcc-4.9.4/gcc/passes.c:2066
0xd1b58a execute_all_ipa_transforms()
../../gcc-4.9.4/gcc/passes.c:2107
0xbd8abd expand_function
../../gcc-4.9.4/gcc/cgraphunit.c:1775
0xf99653 expand_all_functions
../../gcc-4.9.4/gcc/cgraphunit.c:1916
0xf99653 compile()
../../gcc-4.9.4/gcc/cgraphunit.c:2260
0xf98f17 finalize_compilation_unit()
../../gcc-4.9.4/gcc/cgraphunit.c:2337
0xb149dd cp_write_global_declarations()
../../gcc-4.9.4/gcc/cp/decl2.c:4647
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug target/82066] #pragma GCC target documentation does not say it is implemented for aarch64

2017-08-31 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82066

--- Comment #1 from Andrew Pinski  ---
Also the documentation for the target attribute does not point to the aarch64
documentation (it does point to the arm one though):
The options supported are specific to each target; refer to x86 Function
Attributes, PowerPC Function Attributes, ARM Function Attributes,and Nios II
Function Attributes, for details.

[Bug target/82066] New: #pragma GCC target documentation does not say it is implemented for aarch64

2017-08-31 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82066

Bug ID: 82066
   Summary: #pragma GCC target documentation does not say it is
implemented for aarch64
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: documentation
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---
Target: aarch64

Currently the documentation stays:
The #pragma GCC target pragma is presently implemented for x86, PowerPC, and
Nios II targets only.


https://gcc.gnu.org/onlinedocs/gcc/Function-Specific-Option-Pragmas.html#Function-Specific-Option-Pragmas

But this is wrong as it is implemented for AARCH64 (and I think arm).

[Bug bootstrap/82045] [8 regression] SPARC bootstrap broken: ICE in emit_library_call_value_1, at calls.c:4565

2017-08-31 Thread rsandifo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82045

--- Comment #9 from rsandifo at gcc dot gnu.org  
---
Created attachment 42098
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42098=edit
first cut of fix

Here's the patch I'm testing.  Only sanity-checked on aarch64-linux-gnu and
cross sparc-sun-solaris2.11 so far.

[Bug c/82063] issues with arguments enabled by -Wall

2017-08-31 Thread jim.wilson at linaro dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82063

--- Comment #2 from jim.wilson at linaro dot org ---
On Thu, Aug 31, 2017 at 1:32 PM, manu at gcc dot gnu.org
 wrote:
> This is already possible:
> https://gcc.gnu.org/onlinedocs/gccint/Option-properties.html
>
> LangEnabledBy(language, opt)
> LangEnabledBy(language, opt, posarg, negarg)
> ...
>
> See examples in c.opt.

I did already look at examples, and read the docs, and step through
code in the debugger.  Posarg and negarg are integers, which are
ignored for options that take a string as an argument.  So no, this
doesn't work.

Note in optc-gen.awk, where the handle_generated_option call is
generated, the fourth argument is always NULL. This is "const char
*arg" which is the argument for options that take string arguments.
The fifth argument, int value, is where the posarg/negarg value gets
passed.  Also, note, in the file opts-common.c, in the function
set_options, in the case CLVC_STRING, it uses only arg, it does not
use value.  Since the posarg/negarg values end up in value here, they
are ignored, and are useless.

I would rather ask why the -Walloc-size-larger-than= option is
(unsuccessfully) being enabled by -Wall.  It seems an odd one to try
to enable by default.

Another weirdness I just noticed, the docs say that a size suffix is
optional, but in the function alloc_max_size in calls.c, if no suffix
is specified, it does
  unit = 0;
 ...
  w *= unit;
which means the argument always gets ignored unless there is a size
suffix.  I think that should be
  unit = 1;
instead.

[Bug bootstrap/82045] [8 regression] SPARC bootstrap broken: ICE in emit_library_call_value_1, at calls.c:4565

2017-08-31 Thread ro at CeBiTec dot Uni-Bielefeld.DE
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82045

--- Comment #8 from ro at CeBiTec dot Uni-Bielefeld.DE  ---
> (In reply to r...@cebitec.uni-bielefeld.de from comment #6)
[...]
> Ah!  Thanks for debugging it.  I guess the problem is that we're
> passing the new machine_mode classes through ... and interpreting
> them as int in emit_library_call_value_1.  This will only work on
> ABIs that pass the two in the same way.

Which they don't: according to the SPARC psABI, structs are passed by
reference.  And indeed interpreting mode as a scalar_float_mode * yields
the expected E_TFmode value for m_mode.

Rainer

[Bug fortran/82065] New: gfortran rejects redundant use of intrinsic module constant

2017-08-31 Thread damian at sourceryinstitute dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82065

Bug ID: 82065
   Summary: gfortran rejects redundant use of intrinsic module
constant
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: damian at sourceryinstitute dot org
  Target Milestone: ---

gfortran 6, 7, and 8 generate compiler error messages when a variable in the 
iso_fortran_env intrinsic model is accessed via use association where it is
also available via host association:

$ cat use-intrinsic-module-twice.f90 
  use iso_fortran_env
  implicit none
  print *, integer_kinds
  call testsub
contains
  subroutine testsub
use iso_fortran_env
print * , integer_kinds
  end subroutine
end

$ gfortran use-intrinsic-module-twice.f90 
/tmp/ccoAKOqk.s: Assembler messages:
/tmp/ccoAKOqk.s:134: Error: symbol `__iso_fortran_env_MOD_integer_kinds' is
already defined

$ gfortran --version
GNU Fortran (GCC) 8.0.0 20170731 (experimental)

[Bug middle-end/81512] duplicate note in -Walloca-larger-than and alloca in a return statement

2017-08-31 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81512

Manuel López-Ibáñez  changed:

   What|Removed |Added

 CC||manu at gcc dot gnu.org

--- Comment #2 from Manuel López-Ibáñez  ---
This is a general problem of the diagnostics machinery:

* Macro trace is generated after each diagnostic

* There is no way to create one diagnostic that contains several messages.

However, in this particular case, I think the warning could be smarter in one
of two ways:

* The second note could point the argument instead of the alloca call:

a.c:1:16: warning: argument to ‘alloca’ is too large [-Walloca-larger-than=]
 #define alloca __builtin_alloca
^
a.c:5:10: note: in expansion of macro ‘alloca’
   return alloca (12345);
  ^~
a.c:1:23: note: limit is 12344 bytes, but argument is 12345
   return alloca (12345);
  ^

* Alternatively, if the note is always going to be at exactly the same location
as the warning, why not simply include the text in the warning?

a.c:1:16: warning: argument to ‘alloca’ is too large (limit is 12344 bytes, but
argument is 12345) [-Walloca-larger-than=]
 #define alloca __builtin_alloca
^
a.c:5:10: note: in expansion of macro ‘alloca’
   return alloca (12345);
  ^~

Much shorter, saves vertical space.

[Bug c++/69953] [5/6 Regression] Using lto causes gtkmm/gparted and gtkmm/inkscape compile to fail

2017-08-31 Thread dilfridge at gentoo dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69953

--- Comment #35 from Andreas K. Huettel  ---
Oops sorry, that should have been:

According to https://bugs.gentoo.org/show_bug.cgi?id=629342 *not* fixed for
gcc-6.

[Bug c++/69953] [5/6 Regression] Using lto causes gtkmm/gparted and gtkmm/inkscape compile to fail

2017-08-31 Thread dilfridge at gentoo dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69953

Andreas K. Huettel  changed:

   What|Removed |Added

 CC||dilfridge at gentoo dot org

--- Comment #34 from Andreas K. Huettel  ---
According to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69953 *not* fixed for
gcc-6.

[Bug c++/65324] -Wzero-as-null-pointer-constant: incorrect location for function templates

2017-08-31 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65324

Manuel López-Ibáñez  changed:

   What|Removed |Added

 CC||manu at gcc dot gnu.org

--- Comment #6 from Manuel López-Ibáñez  ---
(In reply to Jonathan Wakely from comment #5)
> Bug 52718 has some useful discussion about how to fix this.

I thought David had proposed some mechanism to add locations to constants. That
would fix this issue.

[Bug c/82063] issues with arguments enabled by -Wall

2017-08-31 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82063

Manuel López-Ibáñez  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-08-31
 CC||manu at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Manuel López-Ibáñez  ---
(In reply to Jim Wilson from comment #0)
> Noticed this while looking at the -Wall documentation.
> 
> -Walloc-alloc-size-larger-than= is listed in the c-family/c.opt file as
> being enabled by -Wall, however, nothing is provided for the enable/disable
> values, as is done for every other -Wall enabled options that takes an
> argument.  The code tries to enable it using the default value of 1 and a
> NULL string, but since the option takes a string argument, the 1 value is
> ignored, and the NULL string is used, so it gets set to zero, which disables
> it.  I stepped through cc1 code in the debugger to verify this.  If we
> really do want this enabled by -Wall, then we probably need an extension to
> LangEnabledBy to specify on/off strings for arguments that take strings.

This is already possible:
https://gcc.gnu.org/onlinedocs/gccint/Option-properties.html

LangEnabledBy(language, opt)
LangEnabledBy(language, opt, posarg, negarg)

When compiling for the given language, the option is set to the value of
-opt, if not explicitly set. opt can be also a list of || separated options. In
the second form, if opt is used in the positive form then posarg is considered
to be passed to the option, and if opt is used in the negative form then negarg
is considered to be passed to the option. It is possible to specify several
different languages. Each language must have been declared by an earlier
Language record. See Option file format.

See examples in c.opt.

[Bug target/81504] [7/8 Regression] gcc-7 regression: vec_st in loop misoptimized

2017-08-31 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81504

Bill Schmidt  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #11 from Bill Schmidt  ---
Fixed.

[Bug target/81504] [7/8 Regression] gcc-7 regression: vec_st in loop misoptimized

2017-08-31 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81504

--- Comment #10 from Bill Schmidt  ---
Author: wschmidt
Date: Thu Aug 31 20:28:17 2017
New Revision: 251575

URL: https://gcc.gnu.org/viewcvs?rev=251575=gcc=rev
Log:
2017-08-31  Bill Schmidt  

Backport from mainline
2017-08-25  Bill Schmidt  

PR target/81504
* config/rs6000/rs6000.c (find_alignment_op): Add reference
parameter and_insn and return it.
(recombine_lvx_pattern): Insert a copy to ensure availability of
the base register of the copied masking operation at the point of
the instruction replacement.
(recombine_stvx_pattern): Likewise.


Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/config/rs6000/rs6000.c

[Bug bootstrap/82045] [8 regression] SPARC bootstrap broken: ICE in emit_library_call_value_1, at calls.c:4565

2017-08-31 Thread rsandifo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82045

rsandifo at gcc dot gnu.org  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2017-08-31
   Assignee|unassigned at gcc dot gnu.org  |rsandifo at gcc dot 
gnu.org
 Ever confirmed|0   |1

--- Comment #7 from rsandifo at gcc dot gnu.org  
---
(In reply to r...@cebitec.uni-bielefeld.de from comment #6)
> >> --- Comment #4 from rsandifo at gcc dot gnu.org  >> gnu.org> ---
> > [...]
> >>> Natively, I can easily reproduce the ICE with
> >>> 
> >>> $ cc1 -fpreprocessed libgcc2.i -quiet -mcpu=v9 -o libgcc2.s
> >>> 
> >>> Please note that I'm using a 32-bit compiler; maybe the problem doesn't
> >>> occur on a 64-bit host?
> >>
> >> That's certainly a possibility, although I don't *think* we changed
> >> anything in terms of variable sizes.
> >
> > Just to be sure, I've just built a bi-arch sparcv9-sun-solaris2.11
> > compiler: the 64-bit _multc3.o builds just fine, but the compiler ICEs
> > for the 32-bit just as the 32-bit compiler does.
> 
> On top of that, I've tried both x86_64-pc-linux-gnu x
> sparc-sun-solaris2.11 and i686-pc-linux-gnu x
> sparc-sun-solaris2.11 compilers.  Both compile the preprocessed input
> just fine.
> 
> I've now run the native cc1 under gdb.  This is the full stacktrace:
> 
> #0  fancy_abort (file=file@entry=0x2b86f8
> "/var/gcc/reghunt/trunk/gcc/calls.c", line=line@entry=4563,
> function=function@entry=0x2b8fa0  rtx_def*, libcall_type, machine_mode, int, void*)::__FUNCTION__>
> "emit_library_call_value_1") at /var/gcc/reghunt/trunk/gcc/diagnostic.c:1487
> #1  0x005a06dc in emit_library_call_value_1 (retval=retval@entry=0,
> orgfun=orgfun@entry=0xfa98e540, value=value@entry=0x0,
> fn_type=fn_type@entry=LCT_NORMAL, outmode=outmode@entry=E_SImode,
> nargs=nargs@entry=2, p=0xffbfdfc4, p@entry=0xffbfdfbc) at
> /var/gcc/reghunt/trunk/gcc/calls.c:4562
> #2  0x005a69ac in emit_library_call (orgfun=orgfun@entry=0xfa98e540,
> fn_type=fn_type@entry=LCT_NORMAL, outmode=outmode@entry=E_SImode,
> nargs=nargs@entry=2) at /var/gcc/reghunt/trunk/gcc/calls.c:5146
> #3  0x00eac154 in sparc_emit_float_lib_cmp (x=x@entry=0xfa98c948,
> y=0xfa98c960, comparison=NE) at
> /var/gcc/reghunt/trunk/gcc/config/sparc/sparc.c:8144
> #4  0x00eac3d0 in emit_scc_insn (operands=operands@entry=0xffbfe098) at
> /var/gcc/reghunt/trunk/gcc/config/sparc/sparc.c:3170
> #5  0x0104c5d0 in gen_cstoretf4 (operand0=0xfa98c978, operand1=0xfa98e530,
> operand2=0xfa98c948, operand3=0xfa98c960) at
> /var/gcc/reghunt/trunk/gcc/config/sparc/sparc.md:779
> #6  0x0099b108 in insn_gen_fn::operator() (a3=, a2= out>, a1=, a0=, this=0x50a0) at
> /var/gcc/reghunt/trunk/gcc/recog.h:303
> #7  maybe_gen_insn (icode=icode@entry=CODE_FOR_cstoretf4, nops=nops@entry=4,
> ops=ops@entry=0xffbfe1d8) at /var/gcc/reghunt/trunk/gcc/optabs.c:7046
> #8  0x0099b6ec in maybe_expand_insn (icode=icode@entry=CODE_FOR_cstoretf4,
> nops=nops@entry=4, ops=ops@entry=0xffbfe1d8) at
> /var/gcc/reghunt/trunk/gcc/optabs.c:7076
> #9  0x006eaea4 in emit_cstore (target=target@entry=0xfa9830e0,
> icode=icode@entry=CODE_FOR_cstoretf4, code=code@entry=NE,
> mode=mode@entry=E_TFmode, compare_mode=compare_mode@entry=E_TFmode,
> unsignedp=unsignedp@entry=0, x=0xfa98c948, x@entry=0xfa98e4d0, y=0xfa98c960,
> y@entry=0xfa98e4f0, normalizep=normalizep@entry=1,
> target_mode=target_mode@entry=E_QImode) at
> /var/gcc/reghunt/trunk/gcc/expmed.c:5325
> #10 0x006eb5f0 in emit_store_flag_1 (target=target@entry=0xfa9830e0,
> code=NE, op0=op0@entry=0xfa98e4d0, op1=op1@entry=0xfa98e4f0,
> mode=mode@entry=E_TFmode, unsignedp=unsignedp@entry=0,
> normalizep=normalizep@entry=1, target_mode=target_mode@entry=E_QImode) at
> /var/gcc/reghunt/trunk/gcc/expmed.c:5563
> #11 0x006eb050 in emit_store_flag (target=target@entry=0xfa9830e0,
> code=code@entry=NE, op0=op0@entry=0xfa98e4d0, op1=op1@entry=0xfa98e4f0,
> mode=mode@entry=E_TFmode, unsignedp=unsignedp@entry=0, normalizep= out>, normalizep@entry=1) at /var/gcc/reghunt/trunk/gcc/expmed.c:5823
> #12 0x006ec308 in emit_store_flag_force (target=target@entry=0xfa9830e0,
> code=code@entry=NE, op0=0xfa98e4d0, op1=0xfa98e4f0,
> mode=mode@entry=E_TFmode, unsignedp=unsignedp@entry=0, normalizep= out>, normalizep@entry=1) at /var/gcc/reghunt/trunk/gcc/expmed.c:5956
> #13 0x00713fe0 in do_store_flag (mode=, target=0xfa9830e0,
> ops=0xffbfe458) at /var/gcc/reghunt/trunk/gcc/expr.c:11511
> #14 expand_expr_real_2 (ops=ops@entry=0xffbfe500,
> target=target@entry=0xfa9830e0, tmode=,
> modifier=modifier@entry=EXPAND_NORMAL) at
> /var/gcc/reghunt/trunk/gcc/expr.c:9259
> #15 0x005b968c in expand_gimple_stmt_1 (stmt=0xfa89a2a0) at
> /var/gcc/reghunt/trunk/gcc/cfgexpand.c:3691
> #16 expand_gimple_stmt (stmt=stmt@entry=0xfa89a2a0) at
> 

[Bug c++/81942] ICE on empty constexpr constructor with C++14

2017-08-31 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81942

Paolo Carlini  changed:

   What|Removed |Added

 CC||jose.marchesi at oracle dot com

--- Comment #6 from Paolo Carlini  ---
It would be nice if somebody with a fully functional ARM toolchain could check
whether something like the below at least avoids the ICE without causing any
regressions. I hope it does.

Index: constexpr.c
===
--- constexpr.c (revision 251553)
+++ constexpr.c (working copy)
@@ -3679,7 +3679,7 @@ breaks (tree *jump_target)
 {
   return *jump_target
 && ((TREE_CODE (*jump_target) == LABEL_DECL
-&& LABEL_DECL_BREAK (*jump_target))
+&& (LABEL_DECL_BREAK (*jump_target) || DECL_ARTIFICIAL
(*jump_target)))
|| TREE_CODE (*jump_target) == EXIT_EXPR);
 }

[Bug c++/81942] ICE on empty constexpr constructor with C++14

2017-08-31 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81942

--- Comment #5 from Paolo Carlini  ---
Such labels are special: they are DECL_ARTIFICIAL and are created by
create_artificial_label called by start_preparsed_function.

[Bug bootstrap/81926] go/parse.o differs between stage2 and stage3

2017-08-31 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81926

--- Comment #23 from Eric Botcazou  ---
OK, I can reproduce with BUILD_CONFIG set to empty:

Comparing stages 2 and 3
Bootstrap comparison failure!
gcc/go/parse.o differs
make[2]: *** [compare] Error 1

$ grep BUILD_CONFIG config.log
configure:6993: checking for default BUILD_CONFIG
BUILD_CONFIG=''

so this is indeed similar to PR bootstrap/77995.

 35 .debug_info   0016367a      0001faf8  2**0
  CONTENTS, RELOC, READONLY, DEBUGGING

 35 .debug_info   00163670      0001faf8  2**0
  CONTENTS, RELOC, READONLY, DEBUGGING

The most glaring difference in the assembly file is:

.byte   0   ! end of children of DIE 0x161dbc
.byte   0   ! end of children of DIE 0x161d9c
.byte   0   ! end of children of DIE 0x161d5b
-   .byte   0xf2,0x1! uleb128 0xf2; (DIE (0x161dd2)
DW_TAG_ptr_to_member_type)
-   .uaword 0x10445d! DW_AT_containing_type
-   .uaword 0x14806e! DW_AT_type
-   .byte   0xa5,0x1! uleb128 0xa5; (DIE (0x161ddc)
DW_TAG_subprogram)
+   .byte   0xa5,0x1! uleb128 0xa5; (DIE (0x161dd2)
DW_TAG_subprogram)
.uaword 0x146733! DW_AT_abstract_origin

[Bug c++/81942] ICE on empty constexpr constructor with C++14

2017-08-31 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81942

--- Comment #4 from Paolo Carlini  ---
Adding more details.
The GOTO_EXPR is generated for such targets in finish_return_stmt:

 903   if (DECL_DESTRUCTOR_P (current_function_decl)
 904   || (DECL_CONSTRUCTOR_P (current_function_decl)
 905   && targetm.cxx.cdtor_returns_this ()))
 906 {
 907   /* Similarly, all destructors must run destructors for
 908  base-classes before returning.  So, all returns in a
 909  destructor get sent to the DTOR_LABEL; finish_function emits
 910  code to return a value there.  */
 911   return finish_goto_stmt (cdtor_label);
 912 }

[Bug tree-optimization/82060] [7/8 Regression] ICE in refs_may_alias_p_1 with devirtualization enabled

2017-08-31 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82060

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
   Target Milestone|--- |7.3

[Bug fortran/82064] [OOP] multiple incompatible definitions of extended derived type via module use

2017-08-31 Thread daanvanvugt at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82064

--- Comment #1 from Daan van Vugt  ---
the
!use mod_boris
should be
!use mod_f
to work around the problem in the attachment and code below

[Bug fortran/82064] New: [OOP] multiple incompatible definitions of extended derived type via module use

2017-08-31 Thread daanvanvugt at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82064

Bug ID: 82064
   Summary: [OOP] multiple incompatible definitions of extended
derived type via module use
   Product: gcc
   Version: 7.1.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: daanvanvugt at gmail dot com
  Target Milestone: ---

Created attachment 42097
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42097=edit
Makefile, base type, extra module and test program

When using an extended derived type from a module through two, different, other
modules they become incompatible.
The interesting part is that I use `private` everywhere so the type itself is
not actually shared.

This results in interesting phenomena such as select type not working as
expected, and errors of class(t1) not matching class(t1).

In the attached zip file are the files needed to reproduce.
Run `make` to create `test_sep` from test_sep.f90 which prints ERR twice on my
machine.
Putting all the modules and the program together in one file yields a program
that prints OK twice. (test.f90)

I have written some changes that cause the problem to disappear as comments.



module mod_types
  type, abstract :: t
  end type t
  type, extends(t) :: t2
  end type t2
end module mod_types

module mod_f
  use mod_types
  implicit none
  private
contains
! Remove this function to fix
subroutine f(particle)
  ! if the classname here matches the type name in test_sep it breaks
  class(t2), intent(inout) :: particle
  ! using type instead of class here also works
end subroutine f
end module mod_f

module mod_test
  use mod_types
  !use mod_boris ! uncomment for a fix
  implicit none
  private
  public :: init
contains

subroutine init(p)
  class(t), intent(inout) :: p
  select type (p)
  type is (t2)
write(*,*) "OK"
  class default
write(*,*) "ERR"
  end select
end subroutine init
end module mod_test




program test_sep
use mod_types
use mod_f ! remove this to fix
use mod_test

class(t), allocatable :: p
type(t2) :: p2
allocate(t2::p)
call init(p)
call init(p2)
end program test_sep

[Bug other/82063] New: issues with arguments enabled by -Wall

2017-08-31 Thread wilson at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82063

Bug ID: 82063
   Summary: issues with arguments enabled by -Wall
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: other
  Assignee: unassigned at gcc dot gnu.org
  Reporter: wilson at gcc dot gnu.org
  Target Milestone: ---

Noticed this while looking at the -Wall documentation.

-Walloc-alloc-size-larger-than= is listed in the c-family/c.opt file as being
enabled by -Wall, however, nothing is provided for the enable/disable values,
as is done for every other -Wall enabled options that takes an argument.  The
code tries to enable it using the default value of 1 and a NULL string, but
since the option takes a string argument, the 1 value is ignored, and the NULL
string is used, so it gets set to zero, which disables it.  I stepped through
cc1 code in the debugger to verify this.  If we really do want this enabled by
-Wall, then we probably need an extension to LangEnabledBy to specify on/off
strings for arguments that take strings.

Both -Warray-bounds and -Warray-bounds= are listed in the c.opt file as being
enabled by -Wall, but they are the same option, and it causes this one option
to be processed twice in the C_handle_option_auto function in the generated
options.c file.  It gets set to the same value twice, so it does work as
intended, but this is wasteful.

[Bug middle-end/82062] New: [8 regression] simple conditional expressions no longer folded

2017-08-31 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82062

Bug ID: 82062
   Summary: [8 regression] simple conditional expressions no
longer folded
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: major
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: ebotcazou at gcc dot gnu.org
  Target Milestone: ---

The patch

2017-08-17  Marek Polacek  

PR middle-end/81814
* fold-const.c (operand_equal_for_comparison_p): Remove code that used
to mimic what shorten_compare did.  Change the return type to bool.
(fold_cond_expr_with_comparison): Update call to
operand_equal_for_comparison_p.
(fold_ternary_loc): Likewise.

has introduced regressions in the folding of simple conditional expressions,
which happens quite a lot in Ada.  Trivial examples for 64-bit targets:

unsigned long foo (int x)
{
  return x > 0 ? (unsigned long) x : 0;
}

unsigned long bar (int x, int y)
{
  return x > y ? (unsigned long) x : (unsigned long) y;
}

The COND_EXPRs are no longer folded into MAX_EXPRs.

[Bug c++/82047] non-existent variable template used to initialize variable

2017-08-31 Thread ldionne.2 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82047

--- Comment #7 from Louis Dionne  ---
Then, I think there's another bug in GCC (or maybe just a QOI issue), since the
following code compiles (wandbox[1]):

  template  constexpr T v;
  template  constexpr T v(888);

  struct S {
constexpr S() : value(999) { }
constexpr S(int x) : value(x) { }
int value;
  };

  static_assert(v.value == 888);


Instead, I would expect to get some error saying that I'm redefining `v` on the
second line. FWIW, Clang does think it's only a declaration [2].


[1]: https://wandbox.org/permlink/c5An5PbMbJdxa9Hj
[2]: https://wandbox.org/permlink/m9VSksjjtFhiQSab

[Bug other/82061] -Wall documentation needs updating

2017-08-31 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82061

Eric Gallager  changed:

   What|Removed |Added

   Keywords||documentation
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-08-31
 CC||egallager at gcc dot gnu.org
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=71283
 Ever confirmed|0   |1

--- Comment #1 from Eric Gallager  ---
Confirmed, related to bug 71283.

[Bug libstdc++/21549] Configure options hard to find

2017-08-31 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=21549

Eric Gallager  changed:

   What|Removed |Added

 CC||egallager at gcc dot gnu.org

--- Comment #4 from Eric Gallager  ---
There's always ./configure --help=recursive from the top level; the "recursive"
makes it print the help text from subdirs like libstdc++ too.

[Bug c++/82047] non-existent variable template used to initialize variable

2017-08-31 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82047

--- Comment #6 from Jonathan Wakely  ---
I don't think it does mandate that. I think I was wrong to say (in comment 1)
that it's only a declaration. I believe it's a definition too.

[Bug other/82061] New: -Wall documentation needs updating

2017-08-31 Thread wilson at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82061

Bug ID: 82061
   Summary: -Wall documentation needs updating
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: other
  Assignee: unassigned at gcc dot gnu.org
  Reporter: wilson at gcc dot gnu.org
  Target Milestone: ---

I see multiple problems with the -Wall documentation.

There are generic options missing, such as -Wframe-address.  There are C++
specific options missing, such as -Wclass-memaccess.  There are C++ specific
options present, but not mentioned as C++ specific, such as -Wreorder.  The
*.opt files need to be checked to see if there are other similar issues.

There are multiple ways to specify that an option is language dependent, e.g.
only for X, only in X, X only, in X.  This is inconsistent, we should probably
choose one and use it consistently.

[Bug c++/82047] non-existent variable template used to initialize variable

2017-08-31 Thread ldionne.2 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82047

Louis Dionne  changed:

   What|Removed |Added

 CC||ldionne.2 at gmail dot com

--- Comment #5 from Louis Dionne  ---
I don't understand why the standard mandates that

  template  constexpr T v;

though it is only a declaration, would actually default-initialize the object
if you try to use it (am I understanding this properly?). I understand that
this is consistent with

  constexpr T x;

which default-initializes `x`, but that is a definition, not a declaration. In
this case, maybe it doesn't make sense to pretend that

  template  constexpr T v;

is only a declaration?

[Bug c++/82039] -Wzero-as-null-pointer-constant triggers when calling std::allocate<...>::allocate

2017-08-31 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82039

--- Comment #4 from Jonathan Wakely  ---
Author: redi
Date: Thu Aug 31 16:45:37 2017
New Revision: 251570

URL: https://gcc.gnu.org/viewcvs?rev=251570=gcc=rev
Log:
PR c++/82039 suppress -Wzero-as-null-pointer-constant warning

PR c++/82039
* include/ext/new_allocator.h (__gnu_cxx::new_allocator::allocate):
Adjust null pointer constant to avoid warning.

Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/include/ext/new_allocator.h

[Bug middle-end/82051] [mips]mips emit different results when compiling union var using -O0/-O2

2017-08-31 Thread joseph at codesourcery dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82051

--- Comment #3 from joseph at codesourcery dot com  ---
On Thu, 31 Aug 2017, zwzhangwen.zhang at huawei dot com wrote:

>volatile long long  f1;

> printf ("g_121.f1=%x\n",g_121.f1);

In addition to the other points people have made about active union 
members, %x is not the correct format for long long; use %llx.

[Bug c++/82029] [8 Regression] bogus error: ‘__PRETTY_FUNCTION__’ was not declared in this scope

2017-08-31 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82029

Jason Merrill  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #3 from Jason Merrill  ---
Fixed.

[Bug c++/82029] [8 Regression] bogus error: ‘__PRETTY_FUNCTION__’ was not declared in this scope

2017-08-31 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82029

--- Comment #2 from Jason Merrill  ---
Author: jason
Date: Thu Aug 31 15:39:04 2017
New Revision: 251567

URL: https://gcc.gnu.org/viewcvs?rev=251567=gcc=rev
Log:
PR c++/82029 - __PRETTY_FUNCTION__ in lambda in template

* pt.c (enclosing_instantiation_of, lambda_fn_in_template_p)
(regenerated_lambda_fn_p): New.
(tsubst_decl) [VAR_DECL]: Use enclosing_instantiation_of.
(tsubst_copy) [VAR_DECL]: Likewise.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-__func__2.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/pt.c

[Bug c++/82047] non-existent variable template used to initialize variable

2017-08-31 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82047

--- Comment #4 from Jonathan Wakely  ---
Because std::complex has a default constructor that initializes all its
members. If you replace S with a type that leaves some members uninitialized
when default-initialized, it fails:

template struct S {};
template constexpr T v;
constexpr auto c = v;  // ok
struct init { int i = 0; };
constexpr auto ok = v;// ok
struct no_init { int i; };
constexpr auto fails = v;  // error

This is consistent with:

constexpr init x;  // ok
constexpr no_init y;   // error
constexpr no_init z{}; // ok

[Bug sanitizer/82046] [7/8 Regression] Bogus -fsanitize=undefined error with -O2 -Wall

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82046

Martin Sebor  changed:

   What|Removed |Added

   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=79265

--- Comment #3 from Martin Sebor  ---
Instrumenting accesses to member arrays at non-zero offset (among others)
provides no benefit (this is bug 79265) and only causes trouble downstream. 
Eliminating the instrumentation will get rid of a good subset of these false
positives and also improve the efficiency of the instrumented code.  I'm hoping
to put together a patch in stage 3.

[Bug c++/82047] non-existent variable template used to initialize variable

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82047

--- Comment #3 from John McFarlane  ---
This still happens when S has member variables.  For example, if `S` is
replaced with `std::complex`, then `v` is `{0,0}`.

[Bug fortran/82055] segfault compiling F2003 functionality: 4.9.3, 5.3.0 and 6.3.0

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82055

--- Comment #2 from Will Sawyer  ---
Created attachment 42096
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42096=edit
src and build directories with code to isolate bug

[Bug libstdc++/80335] perf of copying std::optional

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80335

sgunderson at bigfoot dot com changed:

   What|Removed |Added

 CC||sgunderson at bigfoot dot com

--- Comment #1 from sgunderson at bigfoot dot com ---
This also affects the _returning_ std::optional; since it is not trivially copy
constructible, std::optional must be returned (at least on amd64) by means
of a hidden parameter instead of in registers.

Since this affects the return type ABI, it can't be changed easily
after-the-fact, so if possible, it should be fixed before C++17 support becomes
non-experimental.

[Bug tree-optimization/82060] New: [7/8 Regression] ICE in refs_may_alias_p_1 with devirtualization enabled

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82060

Bug ID: 82060
   Summary: [7/8 Regression] ICE in refs_may_alias_p_1 with
devirtualization enabled
   Product: gcc
   Version: 7.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: wielkiegie at gmail dot com
  Target Milestone: ---

Created attachment 42095
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42095=edit
Annotated test case used in order to reproduce the bug

Attached is a minimal test case that triggers an Internal Compiler Error in
refs_may_alias_p_1 when compiling at least with -O1 -fdevirtualize. The bug
occurs on gcc 7 and the current snapshot (tested on godbolt).

I have tried to check which -O1 optimization is needed alongside -fdevirtualize
in order to trigger this bug, but when I replaced -O1 with a list of -f options
from the gcc manual the bug went away. I also tried to list the -O1
optimizations using `-Q --help=optimizers', but it didn't help. It might be
something not listed there or otherwise hidden inside the -O1 setting.

Comments in the test case show what is needed in order to encounter this bug.
Some of these might be erroneous, but if I tried to simplify/change any of
these, the bug goes away.

$ g++ -O1 -fdevirtualize testcase.cpp 
testcase.cpp: In function ‘void foo(D&)’:
testcase.cpp:30:1: internal compiler error: in refs_may_alias_p_1, at
tree-ssa-alias.c:1538
 }
 ^
0xbd1e49 refs_may_alias_p_1(ao_ref*, ao_ref*, bool)
../../gcc/tree-ssa-alias.c:1538
0xbd3369 stmt_may_clobber_ref_p_1(gimple*, ao_ref*)
../../gcc/tree-ssa-alias.c:2289
0xbd3b0a walk_aliased_vdefs_1
../../gcc/tree-ssa-alias.c:2947
0xbd3b9d walk_aliased_vdefs_1
../../gcc/tree-ssa-alias.c:2934
0xbd3c41 walk_aliased_vdefs(ao_ref*, tree_node*, bool (*)(ao_ref*, tree_node*,
void*), void*, bitmap_head**, bool*, unsigned int)
../../gcc/tree-ssa-alias.c:2970
0x96d2ec ipa_polymorphic_call_context::get_dynamic_type(tree_node*, tree_node*,
tree_node*, gimple*)
../../gcc/ipa-polymorphic-call.c:1680
0xc43392 eliminate_dom_walker::before_dom_children(basic_block_def*)
../../gcc/tree-ssa-pre.c:4604
0x10fe12a dom_walker::walk(basic_block_def*)
../../gcc/domwalk.c:265
0xc42c01 eliminate
../../gcc/tree-ssa-pre.c:4773
0xc42f44 execute
../../gcc/tree-ssa-pre.c:5207
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug debug/54568] --eh-frame-hdr should also be enabled for static executable

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54568

H.J. Lu  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-08-31
 Ever confirmed|0   |1

--- Comment #5 from H.J. Lu  ---
-static -flto may not work without --eh-frame-hdr:

https://sourceware.org/ml/binutils/2017-08/msg00365.html

since LTO may pull in object files after crtend.o.

[Bug c++/81860] [7/8 Regression] Call to undefined inline function involving inheriting constructors

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81860

--- Comment #2 from Jonathan Wakely  ---
tmp$ g++ test-case3.cpp -c && nm test-case3.o
 U _ZN1AIjEC1Ev
 W _ZN1BC1IiEET_RK1AIjE
 W _ZN1BC2IiEET_RK1AIjE
 n _ZN1BC5IiEET_RK1AIjE
 W _ZN1CCI11BIiEET_RK1AIjE
 W _ZN1CCI21BIiEET_RK1AIjE
 n _ZN1CCI51BIiEET_RK1AIjE
 T main
tmp$ g++ test-case3.cpp -c -fno-new-inheriting-ctors && nm test-case3.o
 W _ZN1AIjEC1Ev
 W _ZN1AIjEC2Ev
 n _ZN1AIjEC5Ev
 W _ZN1BC1IiEET_RK1AIjE
 W _ZN1BC2IiEET_RK1AIjE
 n _ZN1BC5IiEET_RK1AIjE
 W _ZN1CC1IiEET_
 W _ZN1CC2IiEET_
 n _ZN1CC5IiEET_
 T main

[Bug c++/81860] [7/8 Regression] Call to undefined inline function involving inheriting constructors

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81860

Jonathan Wakely  changed:

   What|Removed |Added

   Keywords||wrong-code
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-08-31
  Known to work||6.4.0
 Ever confirmed|0   |1
  Known to fail||7.2.0, 8.0

--- Comment #1 from Jonathan Wakely  ---
Confirmed. The missing symbol is generated if -fno-new-inheriting-ctors is
used.

[Bug tree-optimization/82057] ICE with -fgraphite-identity

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82057

--- Comment #1 from Sven C. Dack  ---
Now with the update it looks much like it's a duplicate of 81226 and 80069. I
did a search before posting this bug, but couldn't find anything close to it.

Sorry if I'm reporting the same issue here.

[Bug bootstrap/82045] [8 regression] SPARC bootstrap broken: ICE in emit_library_call_value_1, at calls.c:4565

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82045

--- Comment #6 from ro at CeBiTec dot Uni-Bielefeld.DE  ---
>> --- Comment #4 from rsandifo at gcc dot gnu.org > gnu.org> ---
> [...]
>>> Natively, I can easily reproduce the ICE with
>>> 
>>> $ cc1 -fpreprocessed libgcc2.i -quiet -mcpu=v9 -o libgcc2.s
>>> 
>>> Please note that I'm using a 32-bit compiler; maybe the problem doesn't
>>> occur on a 64-bit host?
>>
>> That's certainly a possibility, although I don't *think* we changed
>> anything in terms of variable sizes.
>
> Just to be sure, I've just built a bi-arch sparcv9-sun-solaris2.11
> compiler: the 64-bit _multc3.o builds just fine, but the compiler ICEs
> for the 32-bit just as the 32-bit compiler does.

On top of that, I've tried both x86_64-pc-linux-gnu x
sparc-sun-solaris2.11 and i686-pc-linux-gnu x
sparc-sun-solaris2.11 compilers.  Both compile the preprocessed input
just fine.

I've now run the native cc1 under gdb.  This is the full stacktrace:

#0  fancy_abort (file=file@entry=0x2b86f8 "/var/gcc/reghunt/trunk/gcc/calls.c",
line=line@entry=4563, function=function@entry=0x2b8fa0
 "emit_library_call_value_1") at
/var/gcc/reghunt/trunk/gcc/diagnostic.c:1487
#1  0x005a06dc in emit_library_call_value_1 (retval=retval@entry=0,
orgfun=orgfun@entry=0xfa98e540, value=value@entry=0x0,
fn_type=fn_type@entry=LCT_NORMAL, outmode=outmode@entry=E_SImode,
nargs=nargs@entry=2, p=0xffbfdfc4, p@entry=0xffbfdfbc) at
/var/gcc/reghunt/trunk/gcc/calls.c:4562
#2  0x005a69ac in emit_library_call (orgfun=orgfun@entry=0xfa98e540,
fn_type=fn_type@entry=LCT_NORMAL, outmode=outmode@entry=E_SImode,
nargs=nargs@entry=2) at /var/gcc/reghunt/trunk/gcc/calls.c:5146
#3  0x00eac154 in sparc_emit_float_lib_cmp (x=x@entry=0xfa98c948, y=0xfa98c960,
comparison=NE) at /var/gcc/reghunt/trunk/gcc/config/sparc/sparc.c:8144
#4  0x00eac3d0 in emit_scc_insn (operands=operands@entry=0xffbfe098) at
/var/gcc/reghunt/trunk/gcc/config/sparc/sparc.c:3170
#5  0x0104c5d0 in gen_cstoretf4 (operand0=0xfa98c978, operand1=0xfa98e530,
operand2=0xfa98c948, operand3=0xfa98c960) at
/var/gcc/reghunt/trunk/gcc/config/sparc/sparc.md:779
#6  0x0099b108 in insn_gen_fn::operator() (a3=, a2=, a1=, a0=, this=0x50a0) at
/var/gcc/reghunt/trunk/gcc/recog.h:303
#7  maybe_gen_insn (icode=icode@entry=CODE_FOR_cstoretf4, nops=nops@entry=4,
ops=ops@entry=0xffbfe1d8) at /var/gcc/reghunt/trunk/gcc/optabs.c:7046
#8  0x0099b6ec in maybe_expand_insn (icode=icode@entry=CODE_FOR_cstoretf4,
nops=nops@entry=4, ops=ops@entry=0xffbfe1d8) at
/var/gcc/reghunt/trunk/gcc/optabs.c:7076
#9  0x006eaea4 in emit_cstore (target=target@entry=0xfa9830e0,
icode=icode@entry=CODE_FOR_cstoretf4, code=code@entry=NE,
mode=mode@entry=E_TFmode, compare_mode=compare_mode@entry=E_TFmode,
unsignedp=unsignedp@entry=0, x=0xfa98c948, x@entry=0xfa98e4d0, y=0xfa98c960,
y@entry=0xfa98e4f0, normalizep=normalizep@entry=1,
target_mode=target_mode@entry=E_QImode) at
/var/gcc/reghunt/trunk/gcc/expmed.c:5325
#10 0x006eb5f0 in emit_store_flag_1 (target=target@entry=0xfa9830e0, code=NE,
op0=op0@entry=0xfa98e4d0, op1=op1@entry=0xfa98e4f0, mode=mode@entry=E_TFmode,
unsignedp=unsignedp@entry=0, normalizep=normalizep@entry=1,
target_mode=target_mode@entry=E_QImode) at
/var/gcc/reghunt/trunk/gcc/expmed.c:5563
#11 0x006eb050 in emit_store_flag (target=target@entry=0xfa9830e0,
code=code@entry=NE, op0=op0@entry=0xfa98e4d0, op1=op1@entry=0xfa98e4f0,
mode=mode@entry=E_TFmode, unsignedp=unsignedp@entry=0, normalizep=, normalizep@entry=1) at /var/gcc/reghunt/trunk/gcc/expmed.c:5823
#12 0x006ec308 in emit_store_flag_force (target=target@entry=0xfa9830e0,
code=code@entry=NE, op0=0xfa98e4d0, op1=0xfa98e4f0, mode=mode@entry=E_TFmode,
unsignedp=unsignedp@entry=0, normalizep=, normalizep@entry=1) at
/var/gcc/reghunt/trunk/gcc/expmed.c:5956
#13 0x00713fe0 in do_store_flag (mode=, target=0xfa9830e0,
ops=0xffbfe458) at /var/gcc/reghunt/trunk/gcc/expr.c:11511
#14 expand_expr_real_2 (ops=ops@entry=0xffbfe500,
target=target@entry=0xfa9830e0, tmode=,
modifier=modifier@entry=EXPAND_NORMAL) at
/var/gcc/reghunt/trunk/gcc/expr.c:9259
#15 0x005b968c in expand_gimple_stmt_1 (stmt=0xfa89a2a0) at
/var/gcc/reghunt/trunk/gcc/cfgexpand.c:3691
#16 expand_gimple_stmt (stmt=stmt@entry=0xfa89a2a0) at
/var/gcc/reghunt/trunk/gcc/cfgexpand.c:3751
#17 0x005bd820 in expand_gimple_basic_block (bb=0xfa9780c0,
disable_tail_calls=disable_tail_calls@entry=false) at
/var/gcc/reghunt/trunk/gcc/cfgexpand.c:5753
#18 0x005c2a7c in (anonymous namespace)::pass_expand::execute (this=, fun=0xfa97) at /var/gcc/reghunt/trunk/gcc/cfgexpand.c:6360
#19 0x009c380c in execute_one_pass (pass=pass@entry=0x15d9b60) at
/var/gcc/reghunt/trunk/gcc/passes.c:2495
#20 0x009c41c0 in execute_pass_list_1 (pass=0x15d9b60, pass@entry=0x15d7440) at
/var/gcc/reghunt/trunk/gcc/passes.c:2584
#21 0x009c425c in execute_pass_list (fn=0xfa97, pass=0x15d7440) at

[Bug tree-optimization/82059] New: [8 Regression] ICE in dump_profile, at gimple-pretty-print.c:89

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82059

Bug ID: 82059
   Summary: [8 Regression] ICE in dump_profile, at
gimple-pretty-print.c:89
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: marxin at gcc dot gnu.org
  Target Milestone: ---

Starting from r249277 we ICE on:

$ cat /tmp/obstack2.i
struct a
{
  char b;
  struct a *c;
} d (), f;
void *e;
long g;
void
h ()
{
  struct a *i = 0;
  if (g)
i = e;
  if (!i)
d ();
  i->c = 
  i->b = *(char *) h;
}

$ ./gcc/xgcc -O2 -fdump-tree-all -Bgcc /tmp/obstack2.i
during GIMPLE pass: isolate-paths
dump file: obstack2.i.120t.isolate-paths

/tmp/obstack2.i: In function ‘_obstack_newchunk’:
/tmp/obstack2.i:15:6: internal compiler error: in dump_profile, at
gimple-pretty-print.c:89
 void _obstack_newchunk() {
  ^
0x623202 dump_profile
../../gcc/gimple-pretty-print.c:89
0x623202 dump_gimple_bb_header
../../gcc/gimple-pretty-print.c:2700
0x623202 gimple_dump_bb(_IO_FILE*, basic_block_def*, int, unsigned long)
../../gcc/gimple-pretty-print.c:2862
0x98414f dump_bb(_IO_FILE*, basic_block_def*, int, unsigned long)
../../gcc/cfghooks.c:276
0xd5e8c4 dump_function_to_file(tree_node*, _IO_FILE*, unsigned long)
../../gcc/tree-cfg.c:7766
0xc65a53 execute_function_dump
../../gcc/passes.c:1760
0x142333c diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*)
../../gcc/diagnostic.c:963
0x142358e diagnostic_impl
../../gcc/diagnostic.c:1099
0x1424214 internal_error(char const*, ...)
../../gcc/diagnostic.c:1422
0x843bc6 fancy_abort(char const*, int, char const*)
../../gcc/diagnostic.c:1488
0x623202 dump_profile
../../gcc/gimple-pretty-print.c:89
0x623202 dump_gimple_bb_header
../../gcc/gimple-pretty-print.c:2700
0x623202 gimple_dump_bb(_IO_FILE*, basic_block_def*, int, unsigned long)
../../gcc/gimple-pretty-print.c:2862
0x98414f dump_bb(_IO_FILE*, basic_block_def*, int, unsigned long)
../../gcc/cfghooks.c:276
0xd5e8c4 dump_function_to_file(tree_node*, _IO_FILE*, unsigned long)
../../gcc/tree-cfg.c:7766
0xc65a53 execute_function_dump
../../gcc/passes.c:1760

I've got patch for that.

[Bug tree-optimization/82059] [8 Regression] ICE in dump_profile, at gimple-pretty-print.c:89

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82059

Martin Liška  changed:

   What|Removed |Added

   Last reconfirmed||2017-8-31
   Assignee|unassigned at gcc dot gnu.org  |marxin at gcc dot 
gnu.org
   Target Milestone|--- |8.0

[Bug rtl-optimization/82058] ICE in process_alt_operands, at lra-constraints.c:2954 (after adding early clobber in .md)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82058

--- Comment #2 from Tom de Vries  ---
(In reply to Tom de Vries from comment #0)
> At r251537, with this patch:
> ...
> diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
> index d61afcf..a42358d 100644
> --- a/gcc/config/i386/sse.md
> +++ b/gcc/config/i386/sse.md
> @@ -1741,7 +1741,7 @@
> (set_attr "mode" "")])
>  
>  (define_insn "srcp14_mask"
> -  [(set (match_operand:VF_128 0 "register_operand" "=v")
> +  [(set (match_operand:VF_128 0 "register_operand" "=")
> (vec_merge:VF_128
>   (vec_merge:VF_128
> (unspec:VF_128
> ...
> 

Written to make it easy to reproduce an ICE encountered for target gcn on
branch gcn for this insn from gcn-valu.md:
...
(define_insn "*mov"
  [(set (match_operand:VEC_2REG_MODE 0 "register_operand" "=")
(vec_merge:VEC_2REG_MODE
   (match_operand:VEC_2REG_MODE 1 "gcn_alu_operand" "0vB")
   (match_operand:VEC_2REG_MODE 3 "gcn_register_or_unspec_operand"
"0U")
  (match_operand:DI 2 "gcn_exec_reg_operand" "e")))]
  "!memory_operand (operands[0], VOIDmode) || register_operand (operands[1],
VOIDmode)"
  "v_mov_b32\t%L0, %L1\n\tv_mov_b32\t%H0, %H1"
  [(set_attr "type" "vop1")
   (set_attr "mode" "")])
...

[Bug rtl-optimization/82058] ICE in process_alt_operands, at lra-constraints.c:2954 (after adding early clobber in .md)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82058

--- Comment #1 from Tom de Vries  ---
Created attachment 42094
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42094=edit
workaround patch

Using this workaround patch, we have instead:
...
0 Early clobber: reject++
3 Matching earlyclobber alt: reject--
0 Matched conflict early clobber reloads: reject == 0
  alt=0,overall=17,losers=3,rld_nregs=1
 Choosing alt 0 in insn 14:  (0) =  (1) vm  (2) v  (3) 0C  (4) Yk
{srcp14v2df_mask}
  Creating newreg=100 from oldreg=93, assigning class ALL_SSE_REGS to r100
  Creating newreg=101, assigning class MASK_EVEX_REGS to r101
   14: r100:V2DF=vec_merge(vec_merge(unspec[r91:V2DF]
152,r100:V2DF,r101:QI),xmm1:V2DF,0x1)
...

resulting in insn:
...
(insn 14 25 24 2 (set (reg:V2DF 23 xmm2 [93])
(vec_merge:V2DF (vec_merge:V2DF (unspec:V2DF [
(reg/v:V2DF 21 xmm0 [orig:91 aD.2698 ] [91])
] UNSPEC_RCP14)
(reg:V2DF 23 xmm2 [93])
(reg:QI 70 k1 [101]))
(reg:V2DF 22 xmm1 [ bD.2699 ])
(const_int 1 [0x1]))) "avx-1.c":7 1503 {srcp14v2df_mask}
 (nil))
...

[Bug c++/82054] [8 Regression] ICE in add_dwarf_attr with -fopenmp and -g

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82054

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #6 from Richard Biener  ---
Fixed.

[Bug rtl-optimization/82058] New: ICE in process_alt_operands, at lra-constraints.c:2954 (after adding early clobber in .md)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82058

Bug ID: 82058
   Summary: ICE in process_alt_operands, at lra-constraints.c:2954
(after adding early clobber in .md)
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

At r251537, with this patch:
...
diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index d61afcf..a42358d 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -1741,7 +1741,7 @@
(set_attr "mode" "")])

 (define_insn "srcp14_mask"
-  [(set (match_operand:VF_128 0 "register_operand" "=v")
+  [(set (match_operand:VF_128 0 "register_operand" "=")
(vec_merge:VF_128
  (vec_merge:VF_128
(unspec:VF_128
...

and this test-case:
...
typedef double v2df __attribute__ ((__vector_size__ (16)));

v2df
foo (unsigned char u, v2df a, v2df b)
{
  v2df zero = __extension__ (typeof (zero)){ 0.0f, 0.0f };
  return __builtin_ia32_rcp14sd_mask (a, b, zero, u);
}
...

compiled like this:
...
$ gcc avx-1.c -O2 -S -mavx512f
...

we run into this ICE:
...
during RTL pass: reload
avx-1.c: In function ‘foo’:
avx-1.c:8:1: internal compiler error: in process_alt_operands, at
lra-constraints.c:2954
 }
 ^
0xdf7053 process_alt_operands
gcc/lra-constraints.c:2954
0xdfafc4 curr_insn_transform
gcc/lra-constraints.c:3850
0xdffdcc lra_constraints(bool)
gcc/lra-constraints.c:4846
0xde2237 lra(_IO_FILE*)
gcc/lra.c:2392
0xd6f378 do_reload
gcc/ira.c:5440
0xd6f83c execute
gcc/ira.c:5624
...

The ICE in more detail:
...
(gdb) 
#6  0x00df7054 in process_alt_operands (only_alternative=-1)
at gcc/lra-constraints.c:2954
2954  lra_assert (reject > 0);
(gdb) p reject
$1 = 0
...

The insn that triggers this ICE:
...
(gdb) call debug_rtx (curr_insn)
(insn 14 12 19 2 (set (reg:V2DF 93)
(vec_merge:V2DF (vec_merge:V2DF (unspec:V2DF [
(reg/v:V2DF 91 [ a ])
] UNSPEC_RCP14)
(const_vector:V2DF [
(const_double:DF 0.0 [0x0.0p+0])
(const_double:DF 0.0 [0x0.0p+0])
])
(subreg:QI (reg:SI 90 [ u ]) 0))
(reg:V2DF 22 xmm1 [ b ])
(const_int 1 [0x1]))) "avx-1.c":7 1503 {srcp14v2df_mask}
 (expr_list:REG_DEAD (reg/v:V2DF 91 [ a ])
(expr_list:REG_DEAD (reg:SI 90 [ u ])
(expr_list:REG_DEAD (reg:V2DF 22 xmm1 [ b ])
(nil)
...

-fira-verbose output:
...
Starting decreasing number of live ranges...

** Local #1: **

   Spilling non-eliminable hard regs: 7
New elimination table:
Can eliminate 16 to 7 (offset=8, prev_offset=0)
Can eliminate 16 to 6 (offset=8, prev_offset=0)
Can eliminate 20 to 7 (offset=0, prev_offset=0)
Can eliminate 20 to 6 (offset=0, prev_offset=0)
0 Early clobber: reject++
3 Matching earlyclobber alt: reject--
...

The documentation of reject is:
...
  /* REJECT is a count of how undesirable this alternative says it is   
 if any reloading is required.  If the alternative matches exactly  
 then REJECT is ignored, but otherwise it gets this much counted
 against it in addition to the reloading needed.  */
  int reject;
...

[Bug lto/81968] [8 regression] early lto debug objects make Solaris ld SEGV

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81968

--- Comment #11 from Richard Biener  ---
Author: rguenth
Date: Thu Aug 31 11:21:40 2017
New Revision: 251560

URL: https://gcc.gnu.org/viewcvs?rev=251560=gcc=rev
Log:
2017-08-31  Richard Biener  

PR lto/81968
* simple-object-elf.c (simple_object_elf_copy_lto_debug_section):
Keep names of removed global symbols.

Modified:
trunk/libiberty/ChangeLog
trunk/libiberty/simple-object-elf.c

[Bug c++/82054] [8 Regression] ICE in add_dwarf_attr with -fopenmp and -g

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82054

--- Comment #5 from Richard Biener  ---
Author: rguenth
Date: Thu Aug 31 11:20:54 2017
New Revision: 251559

URL: https://gcc.gnu.org/viewcvs?rev=251559=gcc=rev
Log:
2017-08-31  Richard Biener  

PR middle-end/82054
* dwarf2out.c (dwarf2out_early_global_decl): Process each
function only once.

* g++.dg/gomp/pr82054.C: New testcase.

Added:
trunk/gcc/testsuite/g++.dg/gomp/pr82054.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/dwarf2out.c
trunk/gcc/testsuite/ChangeLog

[Bug target/81709] __attribute__((interrupt)) should handle SSE registers

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81709

--- Comment #7 from H.J. Lu  ---
(In reply to Anatol from comment #6)
> > I don't believe compiler needs to do all that.
> 
> I might miss something, could you please share why?
> 
> The check for FXSAVE can be a compile time: if compiled for Pentium II tune
> or later then use FXSAVE otherwise use FSAVE.
> 
> if (tune >= 'pentium II')

It should check ISA for SSE, AVX, AVX512, MPX, ...

>   FXSAVE
> else
>   FSAVE
>   ... save whatever FSAVE did not save ...
> end

On newer processors, XSAVE is needed which uses EAX/EDX.

[Bug c++/81942] ICE on empty constexpr constructor with C++14

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81942

Thomas Preud'homme  changed:

   What|Removed |Added

   Keywords|ice-on-invalid-code |ice-on-valid-code

Paolo Carlini  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-08-31
 CC||paolo.carlini at oracle dot com
 Ever confirmed|0   |1

--- Comment #2 from Thomas Preud'homme  ---
(In reply to TC from comment #1)
> Why is this tagged ice-on-invalid? The test case is valid C++14.

My bad, got confused by the error message when building for C++11.

--- Comment #3 from Paolo Carlini  ---
We ICE when cxx_eval_constant_expression encounters a GOTO_EXPR to a LABEL_DECL
target which is neither a break nor a continue. This is the .original:

;; Function constexpr A::A() (null)
;; enabled by -tree-original


{
  // predicted unlikely by goto predictor.;
  goto ;
}
:;
return this;

For comparison, for x86_64 we generate none of that, simply:

;; Function constexpr A::A() (null)
;; enabled by -tree-original


{
  return;
}

A guess an ARM expert is welcome, to understand where the goto is coming
from...

[Bug c++/65324] -Wzero-as-null-pointer-constant: incorrect location for function templates

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65324

Jonathan Wakely  changed:

   What|Removed |Added

   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=52718

--- Comment #5 from Jonathan Wakely  ---
Bug 52718 has some useful discussion about how to fix this.

[Bug c++/65324] -Wzero-as-null-pointer-constant: incorrect location for function templates

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65324

Jonathan Wakely  changed:

   What|Removed |Added

 CC||max at maxbruckner dot de

--- Comment #4 from Jonathan Wakely  ---
*** Bug 82039 has been marked as a duplicate of this bug. ***

[Bug c++/82039] -Wzero-as-null-pointer-constant triggers when calling std::allocate<...>::allocate

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82039

Jonathan Wakely  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #3 from Jonathan Wakely  ---
This has been reported before, see Bug 65324

*** This bug has been marked as a duplicate of bug 65324 ***

[Bug c++/65324] -Wzero-as-null-pointer-constant: incorrect location for function templates

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65324

Jonathan Wakely  changed:

   What|Removed |Added

   Keywords||diagnostic
 Status|RESOLVED|NEW
   Last reconfirmed||2017-08-31
 Resolution|DUPLICATE   |---
 Ever confirmed|0   |1

--- Comment #3 from Jonathan Wakely  ---
This is marked as a dup of PR 52718, but that's FIXED and this clearly isn't
fixed. This affects libstdc++ headers, see PR 82039.

Reopening.

[Bug c++/82039] -Wzero-as-null-pointer-constant triggers when calling std::allocate<...>::allocate

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82039

--- Comment #2 from Jonathan Wakely  ---
Minimal testcase for the front-end bug:

template void f(void* = 0) { }
int main()
{
  f();
}

loc.cc: In function 'void f(void*) [with T = int]':
loc.cc:4:10: warning: zero as null pointer constant
[-Wzero-as-null-pointer-constant]
   f();
  ^

It's not useful to show the call site, since that isn't where the
null-pointer-constant is. The first line even says "In function ..." but then
the loc.cc:4:10 locus and the caret show a location that isn't in that function
at all.

[Bug rtl-optimization/82057] New: ICE with -fgraphite-identity

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82057

Bug ID: 82057
   Summary: ICE with -fgraphite-identity
   Product: gcc
   Version: 7.2.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: sven.c.dack at sky dot com
  Target Milestone: ---

Created attachment 42093
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42093=edit
bug.c

Hello,

while compiling ffmpeg with -fgraphite-identity did gcc run into an internal
compiler error. The original command line is this:

gcc -I. -Isrc/ -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DPIC -DZLIB_CONST
-DHAVE_AV_CONFIG_H -pipe -O3 -march=native -fomit-frame-pointer
-fgraphite-identity -floop-nest-optimize -Ofast  -I/home/sven/av/include
-I/usr/local/cuda/include -I/usr/local/Video_Codec_SDK/Samples/common/inc 
-std=c11 -fomit-frame-pointer -fPIC -pthread -I/home/sven/gnu/include
-I/home/sven/av/include -I/home/sven/gnu/include
-I/home/sven/gnu/include/freetype2 -I/home/sven/gnu/include/libpng16
-I/home/sven/gnu/include -I/home/sven/gnu/include/harfbuzz
-I/home/sven/gnu/include/glib-2.0 -I/home/sven/gnu/lib/glib-2.0/include
-I/home/sven/gnu/include -I/home/sven/gnu/include/libxml2
-I/home/sven/gnu/include/freetype2 -I/home/sven/gnu/include/libpng16
-I/home/sven/gnu/include -I/home/sven/gnu/include/harfbuzz
-I/home/sven/gnu/include/glib-2.0 -I/home/sven/gnu/lib/glib-2.0/include
-I/home/sven/gnu/include -I/home/sven/gnu/include/freetype2
-I/home/sven/gnu/include/libpng16 -I/home/sven/gnu/include
-I/home/sven/gnu/include/harfbuzz -I/home/sven/gnu/include/glib-2.0
-I/home/sven/gnu/lib/glib-2.0/include -I/home/sven/gnu/include
-I/home/sven/av/include/opus -I/home/sven/av/include/opus
-I/home/sven/av/include -I/home/sven/av/include -I/home/sven/av/include
-I/home/sven/av/include -I/home/sven/gnu/include  -Wdeclaration-after-statement
-Wall -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings
-Wtype-limits -Wundef -Wmissing-prototypes -Wno-pointer-to-int-cast
-Wstrict-prototypes -Wempty-body -Wno-parentheses -Wno-switch
-Wno-format-zero-length -Wno-pointer-sign -Wno-unused-const-variable -O3
-fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=format-security
-Werror=implicit-function-declaration -Werror=missing-prototypes
-Werror=return-type -Werror=vla -Wformat -fdiagnostics-color=auto
-Wno-maybe-uninitialized  -MMD -MF libavcodec/nellymoser.d -MT
libavcodec/nellymoser.o -c -o libavcodec/nellymoser.o
src/libavcodec/nellymoser.c
src/libavcodec/nellymoser.c: In function 'ff_nelly_get_sample_bits':
src/libavcodec/nellymoser.c:116:6: internal compiler error: in
outer_projection_mupa, at graphite-sese-to-poly.c:1019
 void ff_nelly_get_sample_bits(const float *buf, int *bits)
  ^~~~
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.

I've stripped it down to:

gcc -O3 -fgraphite-identity bug.c -o bug.o
bug.c: In function 'ff_nelly_get_sample_bits':
bug.c:147:13: warning: implicit declaration of function 'abs'
[-Wimplicit-function-declaration]
 if (abs(big_bitsum-198) >=
 ^~~
bug.c:81:6: internal compiler error: in outer_projection_mupa, at
graphite-sese-to-poly.c:1019
 void ff_nelly_get_sample_bits(const float *buf, int *bits)
  ^~~~

and have attached the file bug.c, which is a preprocessed and stripped down
version of the file. I hope you can figure this one out.

I can reproduce the ICE with gcc 6.4 (Debian), 7.2 (Debian) and 7.2.1 (git).

Sven

[Bug c++/82039] -Wzero-as-null-pointer-constant triggers when calling std::allocate<...>::allocate

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82039

Jonathan Wakely  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-08-31
  Component|libstdc++   |c++
 Ever confirmed|0   |1

--- Comment #1 from Jonathan Wakely  ---
The system headers must be valid in both C++98 and C++11 (and all other modes)
so changing the 0 to nullptr is not an option, and so warning about it isn't
useful to anybody (the user can't change the system header, and the system
header can't use nullptr).

I will change it to static_cast(0) to suppress the warning, but I think
the bug here is that the location of the warning is in user code where the
default argument is used, not the system header where the default argument is
defined.

[Bug fortran/82056] Automatic array can be sized via allocatable array

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82056

Dominique d'Humieres  changed:

   What|Removed |Added

   Keywords||diagnostic
   Priority|P3  |P5
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-08-31
 Ever confirmed|0   |1
   Severity|normal  |enhancement

--- Comment #1 from Dominique d'Humieres  ---
The test is coming from
https://groups.google.com/forum/#!topic/comp.lang.fortran/C4TowT3_Vgw.

As pointed out in the discussion, compiling the test with -O -Wall gives

pr82056.f90:8:0:

 real, dimension(size(x)):: y

Warning: 'x.dim[0].ubound' is used uninitialized in this function
[-Wuninitialized]
pr82056.f90:8:0: Warning: 'x.dim[0].lbound' is used uninitialized in this
function [-Wuninitialized]

[Bug fortran/82049] [5/6/7/8 Regression] ICE with character(*),parameter array constructor

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82049

Dominique d'Humieres  changed:

   What|Removed |Added

   Priority|P3  |P4
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-08-31
  Known to work||4.8.5, 4.9.3
Summary|ICE with|[5/6/7/8 Regression] ICE
   |character(*),parameter  |with character(*),parameter
   |array constructor   |array constructor
 Ever confirmed|0   |1
  Known to fail||5.4.0, 6.4.0, 7.2.0, 8.0

--- Comment #1 from Dominique d'Humieres  ---
This is a regression likely caused by r222342 (pr65429). A work around is

  character(*),parameter:: filename = 'ice', stdout = '*'
  integer, parameter:: lenf = len(filename)
  character(*),parameter:: names(2) = [character(len=lenf)::filename,stdout]

[Bug fortran/82056] New: Automatic array can be sized via allocatable array

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82056

Bug ID: 82056
   Summary: Automatic array can be sized via allocatable array
   Product: gcc
   Version: 6.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: arjen.markus at deltares dot nl
  Target Milestone: ---

The following program is accepted without complaints from the compiler:

module chkdim
implicit none

contains

subroutine calculate
real, dimension(:), allocatable :: x
real, dimension(size(x)):: y

write(*,*) 'Sizes:', size(x), size(y)
end subroutine calculate
end module chkdim

program chkit
use chkdim

call calculate
end program chkit

The problem however is that by relating the size of the automatic array (y) to
that of a (local) allocatable array, the size of y is essentially undetermined.

Ideally, the compiler should issue an error or a warning about it.

[Bug c++/82047] non-existent variable template used to initialize variable

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82047

--- Comment #2 from Jonathan Wakely  ---
Actually I wonder if this is due to GCC implementing a solution for
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#253

The relevant rule is:

"A constexpr specifier used in an object declaration declares the object as
const. Such an object shall have literal type and shall be initialized."

And since there are no uninitialized members of S the object is indeed
initialized, despite having no initializer. So I'm not sure this is a bug.

[Bug target/82005] [8 regression] early lto debug creates invalid assembly on Darwin

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82005

--- Comment #13 from rguenther at suse dot de  ---
On Thu, 31 Aug 2017, dominiq at lps dot ens.fr wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82005
> 
> --- Comment #12 from Dominique d'Humieres  ---
> > On LTO tescases or on others? LTO is expected to fail in weird ways
> > until simple object support for mach-o is implemented.
> 
> My gfortran tests run the additional options -g -flto. The dsymutil crash is 
> an
> Apple bug, but it will take me some time to file a self contained bug report.

I'm sure it's fed invalid DWARF but yes, it shouldn't crash on it but
I wouldn't hold my breath for a fix ;)

[Bug c++/82047] non-existent variable template used to initialize variable

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82047

Jonathan Wakely  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-08-31
 Ever confirmed|0   |1

--- Comment #1 from Jonathan Wakely  ---
Confirmed, this is only a declaration not a definition:

template constexpr T v;

[Bug target/82005] [8 regression] early lto debug creates invalid assembly on Darwin

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82005

--- Comment #12 from Dominique d'Humieres  ---
> On LTO tescases or on others? LTO is expected to fail in weird ways
> until simple object support for mach-o is implemented.

My gfortran tests run the additional options -g -flto. The dsymutil crash is an
Apple bug, but it will take me some time to file a self contained bug report.

[Bug fortran/82055] segfault compiling F2003 functionality: 4.9.3, 5.3.0 and 6.3.0

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82055

Dominique d'Humieres  changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2017-08-31
 Ever confirmed|0   |1

--- Comment #1 from Dominique d'Humieres  ---
Please provide a test that can be compiled, i.e., with the needed modules. It
would be nice if you can reduce the test.

[Bug c++/82040] [7/8 Regression] ICE with -Wbool-operation and ~

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82040

Marek Polacek  changed:

   What|Removed |Added

   Target Milestone|--- |7.3
Summary|ICE with -Wbool-operation   |[7/8 Regression] ICE with
   |and ~   |-Wbool-operation and ~

[Bug bootstrap/82045] [8 regression] SPARC bootstrap broken: ICE in emit_library_call_value_1, at calls.c:4565

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82045

--- Comment #5 from ro at CeBiTec dot Uni-Bielefeld.DE  ---
> --- Comment #4 from rsandifo at gcc dot gnu.org  gnu.org> ---
[...]
>> Natively, I can easily reproduce the ICE with
>> 
>> $ cc1 -fpreprocessed libgcc2.i -quiet -mcpu=v9 -o libgcc2.s
>> 
>> Please note that I'm using a 32-bit compiler; maybe the problem doesn't
>> occur on a 64-bit host?
>
> That's certainly a possibility, although I don't *think* we changed
> anything in terms of variable sizes.

Just to be sure, I've just built a bi-arch sparcv9-sun-solaris2.11
compiler: the 64-bit _multc3.o builds just fine, but the compiler ICEs
for the 32-bit just as the 32-bit compiler does.

> This is a bit of a long shot, but maybe still worth trying.
> Could you see what happens if you change:
>
> #if GCC_VERSION >= 4000
> #define ALWAYS_INLINE inline __attribute__ ((always_inline))
> #else
> #define ALWAYS_INLINE inline
> #endif
>
> so that the plain "inline" version is always chosen?

I just did that: makes no difference.

Rainer

[Bug c++/82054] [8 Regression] ICE in add_dwarf_attr with -fopenmp and -g

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82054

Richard Biener  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |rguenth at gcc dot 
gnu.org

[Bug c++/82054] [8 Regression] ICE in add_dwarf_attr with -fopenmp and -g

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82054

--- Comment #4 from Richard Biener  ---
Hmpf, that DW_AT_object_pointer thing is tricky ;)  Ah... first generated by

#6  0x0101629a in expand_omp_taskreg (region=0x2c19ab0)
at /tmp/trunk2/gcc/omp-expand.c:1313
1313(*debug_hooks->early_global_decl) (cfun->decl);
(gdb) l
1308block = gimple_block (entry_stmt);
1309
1310  /* Make sure to generate early debug for the function before
1311 outlining anything.  */
1312  if (! gimple_in_ssa_p (cfun))
1313(*debug_hooks->early_global_decl) (cfun->decl);

and then again via

#6  0x00c72825 in symbol_table::finalize_compilation_unit (
this=0x76895100) at /tmp/trunk2/gcc/cgraphunit.c:2623
2623(*debug_hooks->early_global_decl) (cnode->decl);
(gdb) l
2618{
2619  /* Emit early debug for reachable functions, and by consequence,
2620 locally scoped symbols.  */
2621  struct cgraph_node *cnode;
2622  FOR_EACH_FUNCTION_WITH_GIMPLE_BODY (cnode)
2623(*debug_hooks->early_global_decl) (cnode->decl);

The following resolves this, testing in progress.

Index: gcc/dwarf2out.c
===
--- gcc/dwarf2out.c (revision 251553)
+++ gcc/dwarf2out.c (working copy)
@@ -25492,9 +25492,10 @@ dwarf2out_early_global_decl (tree decl)
   if (TREE_CODE (decl) != TYPE_DECL
   && TREE_CODE (decl) != PARM_DECL)
 {
-  tree save_fndecl = current_function_decl;
   if (TREE_CODE (decl) == FUNCTION_DECL)
{
+ tree save_fndecl = current_function_decl;
+
  /* For nested functions, make sure we have DIEs for the parents first
 so that all nested DIEs are generated at the proper scope in the
 first shot.  */
@@ -25521,11 +25522,19 @@ dwarf2out_early_global_decl (tree decl)
  dwarf2out_decl (origin);
}

- current_function_decl = decl;
+ /* Emit the DIE for decl but avoid doing that multiple times.  */
+ dw_die_ref old_die;
+ if ((old_die = lookup_decl_die (decl)) == NULL
+ || is_declaration_die (old_die))
+   {
+ current_function_decl = decl;
+ dwarf2out_decl (decl);
+   }
+
+ current_function_decl = save_fndecl;
}
-  dwarf2out_decl (decl);
-  if (TREE_CODE (decl) == FUNCTION_DECL)
-   current_function_decl = save_fndecl;
+  else
+   dwarf2out_decl (decl);
 }
   symtab->global_info_ready = save;
 }

[Bug fortran/82055] New: segfault compiling F2003 functionality: 4.9.3, 5.3.0 and 6.3.0

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82055

Bug ID: 82055
   Summary: segfault compiling F2003 functionality:  4.9.3, 5.3.0
and 6.3.0
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: wsawyer at cscs dot ch
  Target Milestone: ---

Created attachment 42092
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42092=edit
Source file (preprocessed)

ftn -cpp -ffree-line-length-none -m64 -g -fbounds-check -fimplicit-none
-ffpe-trap=zero -O -march=native -ffast-math -std=f2003 -pedantic -g
-fbounds-check -Wall -fcheck=all -Wextra -fbacktrace -finit-real=nan
-save-temps '-DP(EX)=print *,"-->EX:",EX'  -c
../src/mo_gas_optics_specification.F90
../src/mo_gas_optics_specification.F90:908:75:

   function get_minor_list(this, gas_desc, ngas, names_spec, kminor_activity)
   1
Warning: Unused dummy argument 'kminor_activity' at (1)
[-Wunused-dummy-argument]
../src/mo_gas_optics_specification.F90:550:27:

 ncol, nlay, ngpt, nband, ngas, nflav,   &
   1
Warning: Unused dummy argument 'nband' at (1) [-Wunused-dummy-argument]
../src/mo_gas_optics_specification.F90:534:0:

 minor_gas_list = this%get_minor_list(gas_desc, ngas, this%gas_names,
this%kminor_activity)

internal compiler error: Segmentation fault
0xacf70f crash_signal
../../cray-gcc-6.3.0-201701050407.93fe37becc347/gcc/toplev.c:333
0x8963ce size_binop_loc(unsigned int, tree_code, tree_node*, tree_node*)
../../cray-gcc-6.3.0-201701050407.93fe37becc347/gcc/fold-const.c:1755
0x865ac7 get_inner_reference(tree_node*, long*, long*, tree_node**,
machine_mode*, int*, int*, int*, bool)
../../cray-gcc-6.3.0-201701050407.93fe37becc347/gcc/expr.c:6966
0x897650 fold_unary_loc(unsigned int, tree_code, tree_node*, tree_node*)
../../cray-gcc-6.3.0-201701050407.93fe37becc347/gcc/fold-const.c:7807
0x897b19 fold_build1_stat_loc(unsigned int, tree_code, tree_node*, tree_node*)
../../cray-gcc-6.3.0-201701050407.93fe37becc347/gcc/fold-const.c:12494
0x7185f0 gfc_trans_string_copy(stmtblock_t*, tree_node*, tree_node*, int,
tree_node*, tree_node*, int)
   
../../cray-gcc-6.3.0-201701050407.93fe37becc347/gcc/fortran/trans-expr.c:6430
0x7189bd gfc_trans_scalar_assign(gfc_se*, gfc_se*, gfc_typespec, bool, bool)
   
../../cray-gcc-6.3.0-201701050407.93fe37becc347/gcc/fortran/trans-expr.c:8303
0x724f71 gfc_trans_assignment_1
   
../../cray-gcc-6.3.0-201701050407.93fe37becc347/gcc/fortran/trans-expr.c:9455
0x6eeba1 trans_code
   
../../cray-gcc-6.3.0-201701050407.93fe37becc347/gcc/fortran/trans.c:1680
0x71218c gfc_generate_function_code(gfc_namespace*)
   
../../cray-gcc-6.3.0-201701050407.93fe37becc347/gcc/fortran/trans-decl.c:6177
0x6f1e71 gfc_generate_module_code(gfc_namespace*)
   
../../cray-gcc-6.3.0-201701050407.93fe37becc347/gcc/fortran/trans.c:2058
0x6aa22d translate_all_program_units
   
../../cray-gcc-6.3.0-201701050407.93fe37becc347/gcc/fortran/parse.c:5897
0x6aa22d gfc_parse_file()
   
../../cray-gcc-6.3.0-201701050407.93fe37becc347/gcc/fortran/parse.c:6116
0x6ebcc2 gfc_be_parse_file
   
../../cray-gcc-6.3.0-201701050407.93fe37becc347/gcc/fortran/f95-lang.c:201
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.
Makefile.rules:8: recipe for target 'mo_gas_optics_specification.o' failed
make: *** [mo_gas_optics_specification.o] Error 1

[Bug sanitizer/81923] [ASAN] gcc emites wrong odr asan instrumentation for glibc

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81923

--- Comment #8 from Denis Khalikov  ---
Works for me.
Thanks.

[Bug c++/82053] [8 Regression] ICE on invalid code

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82053

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |8.0

[Bug middle-end/82051] [mips]mips emit different results when compiling union var using -O0/-O2

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82051

Richard Biener  changed:

   What|Removed |Added

 CC||rguenth at gcc dot gnu.org

--- Comment #2 from Richard Biener  ---
(In reply to Andrew Pinski from comment #1)
> I don't know if this is defined or not.  Basically 0x549E5CE9L is really
> 0xCE9 which is stored in the bit-field.  The rest of the bits might be still
> undefined or zero.  I don't remember what the C standard says here.

They are undefined.  The question is what the standard says about the
initializer, what union member gets initialized / activated.  One may read
6.7.9/20 as to
always the first member being initialized / activated.

In this case this PR is INVALID.

I suppose you want = { .f1 = 0x549E5CE9L };

[Bug bootstrap/82045] [8 regression] SPARC bootstrap broken: ICE in emit_library_call_value_1, at calls.c:4565

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82045

--- Comment #4 from rsandifo at gcc dot gnu.org  
---
(In reply to r...@cebitec.uni-bielefeld.de from comment #3)
> > --- Comment #1 from rsandifo at gcc dot gnu.org  > gnu.org> ---
> > Could you attach the .i file?  Using a cross compiler, I was able to build 
> > the
> 
> Sure, done.

Thanks.  This also works with the cross compiler, even though it
does seem to be going through the same code path as the one shown
in the backtrace.

> > parts of libgcc that don't depend on system headers, and _multc3.o built OK 
> > for
> > me.  But that probably isn't indicative of what happens on real Solaris.
> 
> Natively, I can easily reproduce the ICE with
> 
> $ cc1 -fpreprocessed libgcc2.i -quiet -mcpu=v9 -o libgcc2.s
> 
> Please note that I'm using a 32-bit compiler; maybe the problem doesn't
> occur on a 64-bit host?

That's certainly a possibility, although I don't *think* we changed
anything in terms of variable sizes.

This is a bit of a long shot, but maybe still worth trying.
Could you see what happens if you change:

#if GCC_VERSION >= 4000
#define ALWAYS_INLINE inline __attribute__ ((always_inline))
#else
#define ALWAYS_INLINE inline
#endif

so that the plain "inline" version is always chosen?

[Bug c/82050] [8 Regression] ICE on invalid code on x86_64-linux-gnu in column_range, at diagnostic-show-locus.c:1403

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82050

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |8.0

[Bug target/82048] [7 Regression] GCC bootstrap fails in stage1 on sparc-unknown-linux-gnu

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82048

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |7.3

[Bug sanitizer/82046] [7/8 Regression] Bogus -fsanitize=undefined error with -O2 -Wall

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82046

Richard Biener  changed:

   What|Removed |Added

   Keywords||diagnostic
   Priority|P3  |P2
   Target Milestone|--- |7.3

[Bug sanitizer/82046] [7/8 Regression] Bogus -fsanitize=undefined error with -O2 -Wall

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82046

--- Comment #2 from Richard Biener  ---
I suppose fancy threading gets in the way...

   [84.09%]:
  # p_4 = PHI 
  if (p_4 == 0B)
goto ; [0.04%]
  else
goto ; [99.96%]

   [0.03%]:
  __builtin___ubsan_handle_nonnull_arg (&*.Lubsan_data0);
  __builtin_sprintf (0B, "%lu", last_count_13);
  __builtin___ubsan_handle_nonnull_arg (&*.Lubsan_data2);

   [84.09%]:
  _1 = __builtin_strlen (p_4);

threaded the two nonnull checks on p for sprintf and strlen.

Not sure what we can do about these cases (besides forcing no-warning
on all stmts in duplicated blocks by threading).  Less stupid
sanitizing maybe, or earlier simplifying.  Or not exposing the
NULL checks early but combine them with the sanitizer builtins.

__builtin___ubsan_handle_nunull_arg (p_4, &*.Lubsan_data0);

etc.  this way we can even "CSE" dominating ones (I suppose getting
the redundant ubsan warning on strlen isn't important).  We'd then
lower the control flow at sanopt time for example or in an extra pass.

[Bug sanitizer/82046] [7/8 Regression] Bogus -fsanitize=undefined error with -O2 -Wall

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82046

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-08-31
 CC||msebor at gcc dot gnu.org
Summary|Bogus -fsanitize=undefined  |[7/8 Regression] Bogus
   |error with -O2 -Wall|-fsanitize=undefined error
   ||with -O2 -Wall
 Ever confirmed|0   |1
  Known to fail||7.2.0, 8.0

--- Comment #1 from Martin Liška  ---
Confirmed, started with r243661.

[Bug bootstrap/82045] [8 regression] SPARC bootstrap broken: ICE in emit_library_call_value_1, at calls.c:4565

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82045

--- Comment #3 from ro at CeBiTec dot Uni-Bielefeld.DE  ---
> --- Comment #1 from rsandifo at gcc dot gnu.org  gnu.org> ---
> Could you attach the .i file?  Using a cross compiler, I was able to build the

Sure, done.

> parts of libgcc that don't depend on system headers, and _multc3.o built OK 
> for
> me.  But that probably isn't indicative of what happens on real Solaris.

Natively, I can easily reproduce the ICE with

$ cc1 -fpreprocessed libgcc2.i -quiet -mcpu=v9 -o libgcc2.s

Please note that I'm using a 32-bit compiler; maybe the problem doesn't
occur on a 64-bit host?

Rainer

[Bug c++/82054] [8 Regression] ICE in add_dwarf_attr with -fopenmp and -g

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82054

--- Comment #3 from Martin Liška  ---
Reduced test-case:

class a
{
  bool b ();
};
bool
a::b ()
{
#pragma omp parallel
  ;
}

[Bug bootstrap/82045] [8 regression] SPARC bootstrap broken: ICE in emit_library_call_value_1, at calls.c:4565

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82045

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |8.0

[Bug bootstrap/82045] [8 regression] SPARC bootstrap broken: ICE in emit_library_call_value_1, at calls.c:4565

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82045

--- Comment #2 from Rainer Orth  ---
Created attachment 42091
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42091=edit
preprocessed input

[Bug c++/82040] ICE with -Wbool-operation and ~

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82040

Marek Polacek  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |mpolacek at gcc dot 
gnu.org

[Bug c++/82054] [8 Regression] ICE in add_dwarf_attr with -fopenmp and -g

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82054

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-08-31
 CC||marxin at gcc dot gnu.org,
   ||rguenth at gcc dot gnu.org
   Target Milestone|--- |8.0
Summary|ice in add_dwarf_attr with  |[8 Regression] ICE in
   |-fopenmp and -g |add_dwarf_attr with
   ||-fopenmp and -g
 Ever confirmed|0   |1

--- Comment #2 from Martin Liška  ---
Started with r251448, I'll try to reduce it.

[Bug c++/82054] ice in add_dwarf_attr with -fopenmp and -g

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82054

David Binderman  changed:

   What|Removed |Added

Summary|ice in add_dwarf_attr with  |ice in add_dwarf_attr with
   |-fopenmp|-fopenmp and -g

--- Comment #1 from David Binderman  ---
Problem seems to appear between revision 251446 and 251553.

Richard Sandiford made a load of changes yesterday to file dwarf2out.c.

[Bug c/82050] [8 Regression] ICE on invalid code on x86_64-linux-gnu in column_range, at diagnostic-show-locus.c:1403

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82050

Martin Liška  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-08-31
 CC||dmalcolm at gcc dot gnu.org,
   ||marxin at gcc dot gnu.org
Summary|ICE on invalid code on  |[8 Regression] ICE on
   |x86_64-linux-gnu in |invalid code on
   |column_range, at|x86_64-linux-gnu in
   |diagnostic-show-locus.c:140 |column_range, at
   |3   |diagnostic-show-locus.c:140
   ||3
 Ever confirmed|0   |1
  Known to fail||8.0

--- Comment #1 from Martin Liška  ---
Started with r250187.

[Bug lto/81968] [8 regression] early lto debug objects make Solaris ld SEGV

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81968

--- Comment #10 from Richard Biener  ---
(In reply to rguent...@suse.de from comment #9)
> On Tue, 29 Aug 2017, ro at CeBiTec dot Uni-Bielefeld.DE wrote:
> 
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81968
> > 
> > --- Comment #8 from ro at CeBiTec dot Uni-Bielefeld.DE  > Uni-Bielefeld.DE> ---
> > > --- Comment #6 from rguenther at suse dot de  
> > > ---
> > > On Mon, 28 Aug 2017, ro at CeBiTec dot Uni-Bielefeld.DE wrote:
> > [...]
> > > Thanks.  Can you check whether the above patch resolves the extra
> > > warning about section flags?  The symtab entry one will prevail
> > > of course.
> > 
> > Sure: it did indeed in last night's sparc-sun-solaris2.11 and
> > i386-pc-solaris2.11 bootstraps.  Thanks.
> > 
> > However, I noticed now that I'd missed another ld warning:
> > 
> > ld: warning: file /var/tmp//ccS6p31cdebugobjtem: section [29].symtab:
> > symbol[30]: global symbol has no name
> > 
> > and some more.  Seen e.g in gcc.dg/debug/pr41893-1.c with -gdwarf-2 -g3.
> > And indeed elfdump -s shows
> > 
> > ro@colima 112 > elfdump -s /var/tmp//ccCyYAtcdebugobjtem |grep GLOB
> >[29]   00  NOTY GLOB  D0 UNDEF 
> >[31]   00  NOTY GLOB  D0 UNDEF
> 
> Ian steered me to use this in place of what I did before (a COMM
> with zero size and no name).  He said UNDEFs can be global.
> 
> As said, similar to the section removal I do not actually remove
> symbols because that requires editing relocation sections.
> 
> Why does Solaris ld output warnings by default?  Does it have an
> option to suppress them?  It doesn't seem that it considers them
> errors?

Btw, I suppose I can simply leave the names of the global UNDEFs in place.
That'll remove that specific warning.  Still the question is why solaris
ld segfaults and whether there is a way to supress the section warning
by doing some magic to the entry.

[Bug tree-optimization/82052] [8 Regression] ICE with "-O3 -m32" on x86_64-linux-gnu (internal compiler error: in pop_to_marker, at tree-ssa-scopedtables.c:71)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82052

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-08-31
 CC||law at gcc dot gnu.org,
   ||marxin at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Martin Liška  ---
Confirmed, started with r251279.

[Bug c++/82054] New: ice in add_dwarf_attr with -fopenmp

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82054

Bug ID: 82054
   Summary: ice in add_dwarf_attr with -fopenmp
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

Created attachment 42090
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42090=edit
C++ source code

The attached C++ code does this

grid.cpp: In member function ‘bool CSG_Grid::Create(const CSG_Grid&)’:
grid.cpp:1283:1: internal compiler error: in add_dwarf_attr, at
dwarf2out.c:4132
0xa1edde add_dwarf_attr
../../trunk/gcc/dwarf2out.c:4132
0xa1f059 add_AT_die_ref
../../trunk/gcc/dwarf2out.c:4509
0xa4a672 gen_subprogram_die
../../trunk/gcc/dwarf2out.c:22371
0xa4ca03 gen_decl_die
../../trunk/gcc/dwarf2out.c:25320

when compiled by recent gcc trunk. Flags -fopenmp and -g required.

  1   2   >