[Bug tree-optimization/81977] [5/6 Regression] Issue with inline memcpy with optimizations enabled

2017-08-30 Thread vvarada at codeaurora dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81977

--- Comment #6 from vvarada at codeaurora dot org ---
Thank you, Richard.

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

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

Andrew Pinski  changed:

   What|Removed |Added

  Component|c   |middle-end

--- Comment #1 from Andrew Pinski  ---
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.

[Bug fortran/82007] DTIO write format stored in a string leads to severe errors

2017-08-30 Thread jvdelisle at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82007

Jerry DeLisle  changed:

   What|Removed |Added

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

--- Comment #4 from Jerry DeLisle  ---
With gfortran 7.2.1 and trunk, I do not see the error from the write at line
46:

write( unit=10, fmt=fmt_str, iostat=myiostat, iomsg=astring) member

I do see the ICE with this one:

write( unit=10, fmt=trim(fmt_str), iostat=myiostat, iomsg=astring) member

[Bug c/82051] New: [mips]mips emit different results when compiling union var using -O0/-O2

2017-08-30 Thread zwzhangwen.zhang at huawei dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82051

Bug ID: 82051
   Summary: [mips]mips emit different results when compiling union
var using -O0/-O2
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zwzhangwen.zhang at huawei dot com
  Target Milestone: ---

When compiling union var using -O0/-O2, elf print different results.
Command line:
mips-linux-gnueabi-gcc  -w -march=34kc -static ./test.c -O0/-O2

Executing results are as follows:
[O0]
g_121.f0=fce9
g_121.f1=81
g_121.f2=ce90
g_121.f3=ce
g_121.f4=ce
[O2]
g_121.f0=fce9
g_121.f1=81
g_121.f2=ce90
g_121.f3=ce
g_121.f4=fc

==> gcc-6.3.0/7.1.0/8.0.0


I have check the results with X86 compiler, the result is as expected:
g_121.f0=fce9
g_121.f1=ce9
g_121.f2=ce9
g_121.f3=e9
g_121.f4=e9

==> gcc-4.3.4

ccp2 pass g_121.f4 propagates 252 and I have no deep investigattion.

testcase:
#include   
union U0 {
   signed f0 : 12;
   volatile long long  f1;
   volatile int f2;
   const volatile unsigned char  f3;
   unsigned char  f4;
};

static union U0 g_121 = {0x549E5CE9L};/* VOLATILE GLOBAL g_121 */


/*  */
int main (int argc, char* argv[])
{

printf ("g_121.f0=%x\n",g_121.f0);
printf ("g_121.f1=%x\n",g_121.f1);
printf ("g_121.f2=%x\n",g_121.f2);
printf ("g_121.f3=%x\n",g_121.f3);
printf ("g_121.f4=%x\n",g_121.f4);

return 0;
}

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

2017-08-30 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82050

Bug ID: 82050
   Summary: ICE on invalid code on x86_64-linux-gnu in
column_range, at diagnostic-show-locus.c:1403
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The testcase is a bit large.

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/8.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 8.0.0 20170830 (experimental) [trunk revision 251530] (GCC)


$ gcc-trunk abc.c

abc.c:14:58: internal compiler error: in column_range, at
diagnostic-show-locus.c:1403
  unsigned long long
int var_257 = (unsigned long long int) (((8105967947593530303L) | 0) <<
7049221881134420491ULL) * ((unsigned long long int) (0 ((signed char) 0)) *
((unsigned long long int) (~((8866130261576365991L) / ((long int) (0
(var_255))) * unsigned long long int) ((var_253) * (var_83))) *
(((13003573118678480506ULL) * ((unsigned long long int)
(7295088625879320774L))) * ((unsigned long long int) (!((int)
(struct_obj_5.member_1_5)) * (unsigned long long int) ((int)
(struct_obj_5.member_1_6))) * (struct_obj_2.member_1_5)) * (((unsigned long
long int) ((int) (var_130))) * (struct_obj_2.member_1_5))) * unsigned long
long int) ((int) (var_252))) * (struct_obj_1.member_1_0)) * (((unsigned
long long int) (struct_obj_3.member_1_4)) & (struct_obj_4.member_1_5)) &
(((unsigned long long int) (struct_obj_3.member_1_2)) &
(12929547516806536054ULL))) & ((unsigned long long int) ((long int)
(struct_obj_1.member_1_4 & (((~(var_128)) & ((var_128) ^
(struct_obj_3.member_1_5))) | ((unsigned long long int) ((int) ((signed char)
((var_253) & ((unsigned long long int) (struct_obj_3.member_1_3 ^
(((unsigned long long int) ((long int) (((long int) ((int) ((signed char)
(-113 & ((162326598973762782L) & ((long int) ((int) (var_255))) ^
(((unsigned long long int) ((long int) (((long int) ((int) (115))) ^
(struct_obj_4.member_1_3 & (((struct_obj_2.member_1_0) |
(2855696530460496134ULL)) & ((unsigned long long int) (~(var_129 <<
((unsigned long long int) (struct_obj_1.member_1_3)) ^
(struct_obj_6.member_1_1)) << int) 0) | ((int) 0)) - (68))) -
(13835058055282163711ULL)) - (1ULL == ((unsigned long long int) ((int)
int) 7049221881134420491ULL) * ((unsigned long long int) ((int)
((signed char) ((var_254) / (var_254)) * ((unsigned long long int)
(~((8866130261576365991L) / ((long int) ((int) (var_255))) * unsigned
long long int) ((var_253) * (var_257))) * (((13003573118678480506ULL) *
((unsigned long long int) (7295088625879320774L))) * ((unsigned long long int)
(!((int) (struct_obj_5.member_1_5)) * (unsigned long long int) ((int)
(struct_obj_5.member_1_6))) * (struct_obj_2.member_1_5)) * (((unsigned long
long int) ((int) (var_252))) * (struct_obj_2.member_1_5))) * unsigned long
long int) ((int) (var_255))) * (struct_obj_1.member_1_0)) * (((unsigned
long long int) (struct_obj_3.member_1_4)) & (struct_obj_4.member_1_5)) &
(((unsigned long long int) (struct_obj_3.member_1_2)) &
(12929547516806536054ULL))) & ((unsigned long long int) ((long int)
(struct_obj_1.member_1_4 & (((~(var_257)) & ((var_128) ^
(struct_obj_3.member_1_5))) | ((unsigned long long int) ((int) ((signed char)
((var_256) & ((unsigned long long int) (struct_obj_3.member_1_3 ^
(((unsigned long long int) ((long int) (((long int) ((int) ((signed char)
(-113 & ((162326598973762782L) & ((long int) ((int) (var_255))) ^
(((unsigned long long int) ((long int) (((long int) ((int) (115))) ^
(struct_obj_4.member_1_3 & (((struct_obj_2.member_1_0) |
(2855696530460496134ULL)) & ((unsigned long long int) (~(var_254 &&
((int) (((unsigned long long int) (-(var_129))) == (((unsigned long long
int) (struct_obj_3.member_1_4)) & (struct_obj_4.member_1_5)) & (((unsigned long
long int) (struct_obj_3.member_1_2)) & (12929547516806536054ULL))) & ((unsigned
long long int) ((long int) (struct_obj_1.member_1_4 & (((~(var_256)) &
((var_84) ^ (struct_obj_3.member_1_5))) | ((unsigned long long int) ((int)
((signed char) ((var_83) & ((unsigned long long int)
(struct_obj_3.member_1_3 ^ (((unsigned long long int) ((long int)
(((long int) ((int) ((signed char) (-113 & ((162326598973762782L) & ((long
int) (

[Bug fortran/82049] New: ICE with character(*),parameter array constructor

2017-08-30 Thread john.harper at vuw dot ac.nz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82049

Bug ID: 82049
   Summary: ICE with character(*),parameter array constructor
   Product: gcc
   Version: 6.3.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: john.harper at vuw dot ac.nz
  Target Milestone: ---

Internal compiler error presumably due to a character parameter array
constructor.

The program (6 lines):

program ice ! f2003
  implicit none
  character(*),parameter:: filename = 'ice', stdout = '*',&
   names(2) = [character(len(filename))::filename,stdout]
  print "(2A4)",adjustr(names)
end program ice

The compile-time result with gfortran 6.3.1:

cayley[~/Jfh] % gfortran -std=f2003 gfortranice7.f90
f951: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.
cayley[~/Jfh]

Same bad result with -std=f2008. With 3 other compilers (g95,ifort,Sun), the 
program compiled and ran, printing 

 ice   *

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

2017-08-30 Thread anatol.pomozov at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81709

--- Comment #6 from Anatol  ---
> 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')
  FXSAVE
else
  FSAVE
  ... save whatever FSAVE did not save ...
end


[Bug c++/82030] [8 Regression] ICE: Segmentation fault

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

Jason Merrill  changed:

   What|Removed |Added

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

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

[Bug c++/80767] Eager instantiation of generic lambda body when not required

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

--- Comment #4 from Jason Merrill  ---
Author: jason
Date: Wed Aug 30 22:19:33 2017
New Revision: 251549

URL: https://gcc.gnu.org/viewcvs?rev=251549=gcc=rev
Log:
PR c++/82030 - ICE inheriting from multiple lambdas

PR c++/80767
* call.c (compare_ics): Handle null candidate.

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

[Bug c++/82030] [8 Regression] ICE: Segmentation fault

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

--- Comment #2 from Jason Merrill  ---
Author: jason
Date: Wed Aug 30 22:19:33 2017
New Revision: 251549

URL: https://gcc.gnu.org/viewcvs?rev=251549=gcc=rev
Log:
PR c++/82030 - ICE inheriting from multiple lambdas

PR c++/80767
* call.c (compare_ics): Handle null candidate.

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

[Bug libfortran/81939] valgrind error message in build_float_string and heap-buffer-overflow on address sanitized libgfortran.so

2017-08-30 Thread zeccav at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81939

--- Comment #4 from Vittorio Zecca  ---
Dominique, this should be the same traceback as yours but with line numbers:

=
==21064==ERROR: AddressSanitizer: heap-buffer-overflow on address
0x61200177 at pc 0x2ad13bcaa549 bp 0x7ffeba105280 sp 0x7ffeba105278
WRITE of size 1 at 0x61200177 thread T0
#0 0x2ad13bcaa548 in build_float_string
../../../gcc/libgfortran/io/write_float.def:665
#1 0x2ad13bcafcc6 in get_float_string
../../../gcc/libgfortran/io/write_float.def:1068
#2 0x2ad13bcbcd9b in write_float_0 ../../../gcc/libgfortran/io/write.c:1596
#3 0x2ad13bcbcfc3 in _gfortrani_write_f
../../../gcc/libgfortran/io/write.c:1623
#4 0x2ad13bc73af3 in formatted_transfer_scalar_write
../../../gcc/libgfortran/io/transfer.c:2041
#5 0x2ad13bc77902 in formatted_transfer
../../../gcc/libgfortran/io/transfer.c:2279
#6 0x2ad13bc77b86 in _gfortran_transfer_real
../../../gcc/libgfortran/io/transfer.c:2310
#7 0x2ad13bc77bb4 in _gfortran_transfer_real_write
../../../gcc/libgfortran/io/transfer.c:2316
#8 0x40094a in MAIN__ (/home/vitti/1tb/vitti/f95/a.out+0x40094a)
#9 0x400ad5 in main (/home/vitti/1tb/vitti/f95/a.out+0x400ad5)
#10 0x2ad13e579509 in __libc_start_main (/usr/lib64/libc.so.6+0x20509)
#11 0x400729 in _start (/home/vitti/1tb/vitti/f95/a.out+0x400729)

0x61200177 is located 0 bytes to the right of 311-byte region
[0x61200040,0x61200177)
allocated by thread T0 here:
#0 0x2ad13897680a in __interceptor_malloc
../../../../gcc/libsanitizer/asan/asan_malloc_linux.cc:62
#1 0x2ad13aec9b2b in _gfortrani_xmalloc
../../../gcc/libgfortran/runtime/memory.c:42
#2 0x2ad13bcbc9f6 in select_string ../../../gcc/libgfortran/io/write.c:1557
#3 0x2ad13bcbccdf in write_float_0 ../../../gcc/libgfortran/io/write.c:1592
#4 0x2ad13bcbcfc3 in _gfortrani_write_f
../../../gcc/libgfortran/io/write.c:1623
#5 0x2ad13bc73af3 in formatted_transfer_scalar_write
../../../gcc/libgfortran/io/transfer.c:2041
#6 0x2ad13bc77902 in formatted_transfer
../../../gcc/libgfortran/io/transfer.c:2279
#7 0x2ad13bc77b86 in _gfortran_transfer_real
../../../gcc/libgfortran/io/transfer.c:2310
#8 0x2ad13bc77bb4 in _gfortran_transfer_real_write
../../../gcc/libgfortran/io/transfer.c:2316
#9 0x40094a in MAIN__ (/home/vitti/1tb/vitti/f95/a.out+0x40094a)
#10 0x400ad5 in main (/home/vitti/1tb/vitti/f95/a.out+0x400ad5)
#11 0x2ad13e579509 in __libc_start_main (/usr/lib64/libc.so.6+0x20509)

SUMMARY: AddressSanitizer: heap-buffer-overflow
../../../gcc/libgfortran/io/write_float.def:665 in build_float_string
Shadow bytes around the buggy address:
  0x0c247fff7fd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c247fff7fe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c247fff7ff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c247fff8000: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
  0x0c247fff8010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c247fff8020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00[07]fa
  0x0c247fff8030: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
  0x0c247fff8040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c247fff8050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fa
  0x0c247fff8060: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c247fff8070: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:   00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:   fa
  Freed heap region:   fd
  Stack left redzone:  f1
  Stack mid redzone:   f2
  Stack right redzone: f3
  Stack after return:  f5
  Stack use after scope:   f8
  Global redzone:  f9
  Global init order:   f6
  Poisoned by user:f7
  Container overflow:  fc
  Array cookie:ac
  Intra object redzone:bb
  ASan internal:   fe
  Left alloca redzone: ca
  Right alloca redzone:cb
==21064==ABORTING

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

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

Eric Botcazou  changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2017-08-30
 CC||ebotcazou at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Eric Botcazou  ---
This looks like an issue with your libc.  Where does __nldbl_fprintf come from?

[Bug target/68577] [6 Regression] ICE: in expand_direct_optab_fn, at internal-fn.c:2171

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

--- Comment #7 from Andrew Pinski  ---
(In reply to rsand...@gcc.gnu.org from comment #6)
> Patch applied.

This testcase now ICEs on the trunk on aarch64:
/home/jenkins/workspace/BuildThunderX_native_gcc_upstream_CENTOS/gcc/gcc/testsuite/gcc.dg/vect/pr68577.c:20:12:
internal compiler error: in simplify_subreg, at simplify-rtx.c:6050
0xb29693 simplify_subreg(machine_mode, rtx_def*, machine_mode, unsigned int)
../../gcc/gcc/simplify-rtx.c:6049
0xb2d307 simplify_gen_subreg(machine_mode, rtx_def*, machine_mode, unsigned
int)
../../gcc/gcc/simplify-rtx.c:6278
0x7f0bdf store_bit_field_1
../../gcc/gcc/expmed.c:798
0x7f0ec7 store_bit_field(rtx_def*, unsigned long, unsigned long, unsigned long,
unsigned long, machine_mode, rtx_def*, bool)
../../gcc/gcc/expmed.c:1133
0x814567 store_field
../../gcc/gcc/expr.c:6950
0x81b29f store_constructor_field
../../gcc/gcc/expr.c:6142
0x81272f store_constructor
../../gcc/gcc/expr.c:6726
0x813db3 expand_constructor
../../gcc/gcc/expr.c:8027
0x800f2f expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
../../gcc/gcc/expr.c:10133
0x80245b expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
../../gcc/gcc/expr.c:9819
0x80144f expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
../../gcc/gcc/expr.c:10942
0x80245b expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
../../gcc/gcc/expr.c:9819
0x810b07 expand_expr
../../gcc/gcc/expr.h:276
0x810b07 expand_assignment(tree_node*, tree_node*, bool)
../../gcc/gcc/expr.c:4971
0x6f1c1b expand_gimple_stmt_1
../../gcc/gcc/cfgexpand.c:3653
0x6f1c1b expand_gimple_stmt
../../gcc/gcc/cfgexpand.c:3751
0x6f5603 expand_gimple_basic_block
../../gcc/gcc/cfgexpand.c:5750
0x6fa42f execute
../../gcc/gcc/cfgexpand.c:6357
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.
compiler exited with status 1

[Bug target/82002] [8 Regression] ICE in sp_valid_at, at config/i386/i386.c:13233

2017-08-30 Thread daniel.santos at pobox dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82002

--- Comment #2 from Daniel Santos  ---
Another problem when we throw in an ms to sysv call:

$ cat /home/daniel/proj/sys/gcc/git/gcc/testsuite/gcc.target/i386/pr82002-2a.c
/* { dg-do compile { target lp64 } } */
/* { dg-options "-Ofast -mstackrealign -mabi=ms" } */

void __attribute__((sysv_abi)) a (char *);
void
b ()
{
  char c[100];
  c[1099511627776] = 'b';
  a (c);
  a (c);
}


spawn
/home/daniel/proj/sys/gcc/builds/pr82002-minimal-x86_64-pc-linux-gnu/gcc/xgcc
-B/home/daniel/proj/sys/gcc/builds/pr82002-minimal-x86_64-pc-linux-gnu/gcc/
/home/daniel/proj/sys/gcc/git/gcc/testsuite/gcc.target/i386/pr82002-2a.c
-fno-diagnostics-show-caret -fdiagnostics-color=never -Ofast -mstackrealign
-mabi=ms -S -o pr82002-2a.s
/home/daniel/proj/sys/gcc/git/gcc/testsuite/gcc.target/i386/pr82002-2a.c: In
function 'b':
/home/daniel/proj/sys/gcc/git/gcc/testsuite/gcc.target/i386/pr82002-2a.c:12:1:
error: unrecognizable insn:
(insn/f 36 35 37 2 (set (mem/c:V4SF (plus:DI (reg/f:DI 7 sp)
(const_int 116 [0x2540be410])) [2  S16 A128])
(reg:V4SF 27 xmm6))
"/home/daniel/proj/sys/gcc/git/gcc/testsuite/gcc.target/i386/pr82002-2a.c":7 -1
 (expr_list:REG_DEAD (reg:V4SF 27 xmm6)
(expr_list:REG_CFA_EXPRESSION (set (mem/c:V4SF (plus:DI (reg/f:DI 7 sp)
(const_int 116 [0x2540be410])) [2  S16 A128])
(reg:V4SF 27 xmm6))
(nil
during RTL pass: cprop_hardreg
/home/daniel/proj/sys/gcc/git/gcc/testsuite/gcc.target/i386/pr82002-2a.c:12:1:
internal compiler error: in extract_insn, at recog.c:2306
0x5c1958 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
/home/daniel/proj/sys/gcc/git/gcc/rtl-error.c:108
0x5c1974 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
/home/daniel/proj/sys/gcc/git/gcc/rtl-error.c:116
0xba05a9 extract_insn(rtx_insn*)
/home/daniel/proj/sys/gcc/git/gcc/recog.c:2306
0xba15e8 extract_constrain_insn(rtx_insn*)
/home/daniel/proj/sys/gcc/git/gcc/recog.c:2206
0xbaaaf6 copyprop_hardreg_forward_1
/home/daniel/proj/sys/gcc/git/gcc/regcprop.c:801
0xbab8a4 execute
/home/daniel/proj/sys/gcc/git/gcc/regcprop.c:1308


I guess we don't have a 64-bit offset instruction for (v)movabs :)

[Bug c++/82030] [8 Regression] ICE: Segmentation fault

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

Jason Merrill  changed:

   What|Removed |Added

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

[Bug go/82043] error: redefinition of ...

2017-08-30 Thread ian at airs dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82043

--- Comment #3 from Ian Lance Taylor  ---
I'm sorry, I can't support a mix of different GCC sources.  You are welcome to
try to figure out what is going wrong, but I don't know.  At a guess, you are
using a version of libgo/match.sh that does not know about "aix" with sources
that include AIX support.  But I'm not really sure.

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

2017-08-30 Thread aaro.koskinen at iki dot fi
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82048

Bug ID: 82048
   Summary: [7 Regression] GCC bootstrap fails in stage1 on
sparc-unknown-linux-gnu
   Product: gcc
   Version: 7.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: aaro.koskinen at iki dot fi
  Target Milestone: ---

When trying bootstrap GCC 7.2 with:

../gcc-7.2.0/configure --with-cpu=ultrasparc --enable-targets=all
--disable-libsanitizer --disable-nls --prefix=/home/aaro/gcctest/newcompiler
--enable-languages=c,c++ --host=sparc-unknown-linux-gnu
--build=sparc-unknown-linux-gnu --target=sparc-unknown-linux-gnu
--with-system-zlib --with-sysroot=/

gives:

checking whether the target supports .symver directive... yes
configure: versioning on shared library symbols is gnu
checking whether the target supports __sync_*_compare_and_swap... yes
configure: updating cache ./config.cache
configure: error: unsupported system, cannot find sizeof (omp_lock_t)

sparc-unknown-linux-gnu/64/libgomp/config.log tells:

configure:16738: /home/aaro/gcctest/build/./gcc/xgcc
-B/home/aaro/gcctest/build/
./gcc/ -B/home/aaro/gcctest/newcompiler/sparc-unknown-linux-gnu/bin/
-B/home/aar
o/gcctest/newcompiler/sparc-unknown-linux-gnu/lib/ -isystem
/home/aaro/gcctest/n
ewcompiler/sparc-unknown-linux-gnu/include -isystem
/home/aaro/gcctest/newcompil
er/sparc-unknown-linux-gnu/sys-include  -m64 -o conftest -g -O2 -pthread
-pthrea
d -include confdefs.h -include
../../../../gcc-7.2.0/libgomp/config/posix/omp-lo
ck.h   conftest.c -ldl  >&5
/tmp/ccyUji5P.o: In function `main':
/home/aaro/gcctest/build/sparc-unknown-linux-gnu/64/libgomp/conftest.c:80:
undef
ined reference to `__nldbl_fprintf'
collect2: error: ld returned 1 exit status
configure:16738: $? = 1
configure: program exited with status 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU Offloading and Multi Processing Runtime Library"
| #define PACKAGE_TARNAME "libgomp"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "GNU Offloading and Multi Processing Runtime Library
1.
0"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL "http://www.gnu.org/software/libgomp/;
| #define PACKAGE "libgomp"
| #define VERSION "1.0"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| #define STDC_HEADERS 1
| #define TIME_WITH_SYS_TIME 1
| #define STRING_WITH_STRINGS 1
| #define HAVE_PTHREAD_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_SEMAPHORE_H 1
| #define HAVE_SYS_SYSCTL_H 1
| #define HAVE_SYS_TIME_H 1
| #define LIBGOMP_USE_PTHREADS 1
| #define HAVE_LIBDL 1
| #define PLUGIN_SUPPORT 1
| #define HAVE_UNISTD_H 1
| #define HAVE_SECURE_GETENV 1
| #define HAVE_GETUID 1
| #define HAVE_GETEUID 1
| #define HAVE_GETGID 1
| #define HAVE_GETEGID 1
| #define OFFLOAD_TARGETS ""
| #define PLUGIN_NVPTX 0
| #define PLUGIN_NVPTX_DYNAMIC 0
| #define PLUGIN_HSA 0
| #define HSA_RUNTIME_LIB ""
| #define HAVE_GETLOADAVG 1
| #define HAVE_CLOCK_GETTIME 1
| #define HAVE_STRTOULL 1
| #define HAVE_PTHREAD_AFFINITY_NP 1
| #define HAVE_TLS 1
| #define HAVE_ATTRIBUTE_VISIBILITY 1
| #define HAVE_ATTRIBUTE_ALIAS 1
| #define HAVE_AS_SYMVER_DIRECTIVE 1
| #define HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT 1
| #define LIBGOMP_GNU_SYMBOL_VERSIONING 1
| #define HAVE_SYNC_BUILTINS 1
| /* end confdefs.h.  */
| 
| static long int longval () { return sizeof (omp_lock_t); }
| static unsigned long int ulongval () { return sizeof (omp_lock_t); }
| #include 
| #include 
| int
| main ()
| {
| 
|   FILE *f = fopen ("conftest.val", "w");
|   if (! f)
| return 1;
|   if ((sizeof (omp_lock_t)) < 0)
| {
|   long int i = longval ();
|   if (i != (sizeof (omp_lock_t)))
|   |   fprintf (f, "%ld", i);
| }
|   else
| {
|   unsigned long int i = ulongval ();
|   if (i != (sizeof (omp_lock_t)))
|   return 1;
|   fprintf (f, "%lu", i);
| }
|   /* Do not output a trailing newline, as this causes \r\n confusion
|  on some platforms.  */
|   return ferror (f) || fclose (f) != 0;
| 
|   ;
|   return 0;
| }
configure:16741: error: unsupported system, cannot find sizeof (omp_lock_t)

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

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

--- Comment #4 from Dennis Clarke  ---
What if the objective was to have a final 64-bit gcc binary the same as
I have on sparc : 

d # ls -lap /usr/local/gcc7/bin/gcc 
-rwxr-xr-x   3 root root 6275104 Aug 30 18:40 /usr/local/gcc7/bin/gcc

d# file /usr/local/gcc7/bin/gcc
/usr/local/gcc7/bin/gcc: ELF 64-bit MSB executable SPARCV9 Version 1,
dynamically linked, not stripped

[Bug go/82043] error: redefinition of ...

2017-08-30 Thread mfe at live dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82043

--- Comment #2 from martin  ---
I looked at the bash history and I used the trunk source to compile gcc. I'm
sorry for the wrong information.

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

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

Jason Merrill  changed:

   What|Removed |Added

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

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

2017-08-30 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82037

--- Comment #3 from Andreas Schwab  ---
Try configuring with --with-cpu=default32.

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

2017-08-30 Thread john at mcfarlane dot name
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82047

Bug ID: 82047
   Summary: non-existent variable template used to initialize
variable
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: john at mcfarlane dot name
  Target Milestone: ---

The following code compiles:

template struct S {};
template constexpr T v;
constexpr auto c = v;

The result is a variable of type `struct S` which appears to be
value-initialized.

Expected: 
Compiler emits an error for `c` because there is no such variable as `v` of `S`
of `void` (or `v` of anything else for that matter).

Command:
g++ file.cpp -std=c++17

Version:
Observed in 7.1, 7.2 and 8.0 on Wandbox and in 7.1 on Ubuntu 16.04:

Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/home/local/ANT/johmcfj/gcc/libexec/gcc/x86_64-pc-linux-gnu/7.1.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /home/local/ANT/johmcfj/Downloads/gcc-7.1.0/./configure
--disable-multilib --prefix=/home/local/ANT/johmcfj/gcc/
--enable-languages=c,c++,lto
Thread model: posix
gcc version 7.1.0 (GCC)

[Bug tree-optimization/81987] [8 Regression] ICE in verify_ssa with -O3 -march=skylake-avx512

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

--- Comment #8 from Bill Schmidt  ---
Fixed on trunk so far.  Holding this open until the fix is backported in about
a week.

[Bug sanitizer/82046] New: Bogus -fsanitize=undefined error with -O2 -Wall

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

Bug ID: 82046
   Summary: Bogus -fsanitize=undefined error with -O2 -Wall
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: sanitizer
  Assignee: unassigned at gcc dot gnu.org
  Reporter: hjl.tools at gmail dot com
CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
jakub at gcc dot gnu.org, kcc at gcc dot gnu.org, marxin at 
gcc dot gnu.org
  Target Milestone: ---

[hjl@gnu-6 gcc]$ cat /tmp/x.i
typedef struct sym
{
  unsigned long bb_addr[10];
  unsigned long bb_calls[10];
}
Sym;

void
annotate_with_count (Sym *b)
{
  unsigned int i;
  unsigned long last_count;
  char tmpbuf[10 * 30];
  char *p;

  p = tmpbuf;
  *p = '\0';

  for (i = 0; i < 10 && b->bb_addr[i]; i++)
{
  last_count = b->bb_calls[i];
  if (p > tmpbuf)
*p++ = ',';
  __builtin_sprintf (p, "%lu", last_count);
  p += __builtin_strlen (p);
}
}
[hjl@gnu-6 gcc]$ ./xgcc -B./ -S /tmp/x.i -Wall  -O2  -fsanitize=undefined 
/tmp/x.i: In function ‘annotate_with_count’:
/tmp/x.i:24:7: warning: null destination pointer [-Wformat-overflow=]
   __builtin_sprintf (p, "%lu", last_count);
   ^~~~
[hjl@gnu-6 gcc]$

[Bug tree-optimization/81987] [8 Regression] ICE in verify_ssa with -O3 -march=skylake-avx512

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

--- Comment #7 from Bill Schmidt  ---
Author: wschmidt
Date: Wed Aug 30 20:04:07 2017
New Revision: 251547

URL: https://gcc.gnu.org/viewcvs?rev=251547=gcc=rev
Log:
[gcc]

2017-08-30  Bill Schmidt  

PR tree-optimization/81987
* gimple-ssa-strength-reduction.c (insert_initializers): Don't
insert an initializer in a location not dominated by the stride
definition.

[gcc/testsuite]

2017-08-30  Bill Schmidt  

PR tree-optimization/81987
* g++.dg/torture/pr81987.C: New file.


Added:
trunk/gcc/testsuite/g++.dg/torture/pr81987.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/gimple-ssa-strength-reduction.c
trunk/gcc/testsuite/ChangeLog

[Bug fortran/81841] [5/6/7/8 Regression] THREADPRIVATE (OpenMP) wrongly rejected in BLOCK DATA

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

--- Comment #13 from dbroemmel  ---
Created attachment 42089
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42089=edit
testcase for the fix (runtime checks)

A new testcase that possibly checks runtime behaviour.

The snippet is pretty verbose and not too elegant I guess, but it checks what I
pieced together how BLOCK DATA and THREADPRIVATE might behave. I've tested it
with (older version of) gfortran, xlf, ifort, and pgfortran and none of those
abort.

A more recent version of gfortran fails to compile.

Added as a test for dejagnu (to gfortran.dg/gomp), 7.2.0 fails. A 'fixed'
version of 7.2.0 doesn't fail the test.

[Bug bootstrap/82045] New: [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

Bug ID: 82045
   Summary: [8 regression] SPARC bootstrap broken: ICE in
emit_library_call_value_1, at calls.c:4565
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: bootstrap
  Assignee: unassigned at gcc dot gnu.org
  Reporter: ro at gcc dot gnu.org
CC: ebotcazou at gcc dot gnu.org, rsandifo at gcc dot gnu.org
  Target Milestone: ---
Target: sparc-sun-solaris2.11

Within the last day, SPARC bootstrap got broken building the stage1 libgcc:

during RTL pass: expand
/vol/gcc/src/hg/trunk/local/libgcc/libgcc2.c: In function '__multc3':
/vol/gcc/src/hg/trunk/local/libgcc/libgcc2.c:1990:17: internal compiler error:
in emit_library_call_value_1, at calls.c:4565
   if (isnan (x) && isnan (y))
 ^
0x9759f3 emit_library_call_value_1
/vol/gcc/src/hg/trunk/local/gcc/calls.c:4564
0x977e33 emit_library_call(rtx_def*, libcall_type, machine_mode, int, ...)
/vol/gcc/src/hg/trunk/local/gcc/calls.c:5148
0x17330e7 sparc_emit_float_lib_cmp(rtx_def*, rtx_def*, rtx_code)
/vol/gcc/src/hg/trunk/local/gcc/config/sparc/sparc.c:8140
0x171f887 emit_scc_insn(rtx_def**)
/vol/gcc/src/hg/trunk/local/gcc/config/sparc/sparc.c:3174
0x19a0b8f gen_cstoretf4(rtx_def*, rtx_def*, rtx_def*, rtx_def*)
/vol/gcc/src/hg/trunk/local/gcc/config/sparc/sparc.md:779
0xfaa32f insn_gen_fn::operator()(rtx_def*, rtx_def*, rtx_def*, rtx_def*) const
/vol/gcc/src/hg/trunk/local/gcc/recog.h:303
0xfa9c43 maybe_gen_insn(insn_code, unsigned int, expand_operand*)
/vol/gcc/src/hg/trunk/local/gcc/optabs.c:7082
0xfaa00f maybe_expand_insn(insn_code, unsigned int, expand_operand*)
/vol/gcc/src/hg/trunk/local/gcc/optabs.c:7112
0xb6eb1f emit_cstore(rtx_def*, insn_code, rtx_code, machine_mode, machine_mode,
int, rtx_def*, rtx_def*, int, machine_mode)
/vol/gcc/src/hg/trunk/local/gcc/expmed.c:5357
0xb6f84b emit_store_flag_1
/vol/gcc/src/hg/trunk/local/gcc/expmed.c:5600
0xb706ef emit_store_flag(rtx_def*, rtx_code, rtx_def*, rtx_def*, machine_mode,
int, int)
/vol/gcc/src/hg/trunk/local/gcc/expmed.c:5860
0xb70e37 emit_store_flag_force(rtx_def*, rtx_code, rtx_def*, rtx_def*,
machine_mode, int, int)
/vol/gcc/src/hg/trunk/local/gcc/expmed.c:5994
0xbac1c3 do_store_flag
/vol/gcc/src/hg/trunk/local/gcc/expr.c:11546
0xb9f393 expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
/vol/gcc/src/hg/trunk/local/gcc/expr.c:9288
0xba2093 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
/vol/gcc/src/hg/trunk/local/gcc/expr.c:9815
0xb987cb expand_expr_real(tree_node*, rtx_def*, machine_mode, expand_modifier,
rtx_def**, bool)
/vol/gcc/src/hg/trunk/local/gcc/expr.c:8105
0xb73733 expand_expr
/vol/gcc/src/hg/trunk/local/gcc/expr.h:276
0xb96b67 expand_operands(tree_node*, tree_node*, rtx_def*, rtx_def**,
rtx_def**, expand_modifier)
/vol/gcc/src/hg/trunk/local/gcc/expr.c:7704
0xba0d0b expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
/vol/gcc/src/hg/trunk/local/gcc/expr.c:9606
0x999073 expand_gimple_stmt_1
/vol/gcc/src/hg/trunk/local/gcc/cfgexpand.c:3691

A reghunt identified this patch

[7/77] Add scalar_float_mode

This patch adds a scalar_float_mode class, which wraps a mode enum
that is known to satisfy SCALAR_FLOAT_MODE_P.  Things like "SFmode"
now give a scalar_float_mode object instead of a machine_mode.
This in turn needs a change to the real.h format_helper, so that
it can accept both machine_modes and scalar_float_modes.

2017-08-30  Richard Sandiford  
Alan Hayward  
David Sherwood  

gcc/
* coretypes.h (scalar_float_mode): New type.
* machmode.h (mode_traits::from_int): Use machine_mode if
USE_ENUM_MODES is defined.

as the culprit.

  Rainer

[Bug go/82043] error: redefinition of ...

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

--- Comment #1 from Ian Lance Taylor  ---
This can't be GCC 7 branch, because files like libgo/go/runtime/heapdump.go and
libgo/go/runtime/os_aix.go don't exist in GCC 7 branch.  They only exist on
trunk.

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

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

Martin Liška  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-08-30
 CC||marxin at gcc dot gnu.org,
   ||mpolacek at gcc dot gnu.org
 Ever confirmed|0   |1
  Known to fail||6.4.0, 7.2.0, 8.0

--- Comment #1 from Martin Liška  ---
Confirmed, started with Marek's r240462 where the warning was added.

[Bug middle-end/82044] runtime signed integer overflow in check_mem_read_rtx() and all_positions_needed_p() in dse.c

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

Martin Sebor  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=82042

--- Comment #1 from Martin Sebor  ---
The code is syntactically valid but has undefined behavior at runtime.

See also bug 82042 for other similar problems.

[Bug middle-end/82044] New: runtime signed integer overflow in check_mem_read_rtx() and all_positions_needed_p() in dse.c

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

Bug ID: 82044
   Summary: runtime signed integer overflow in
check_mem_read_rtx() and all_positions_needed_p() in
dse.c
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: msebor at gcc dot gnu.org
  Target Milestone: ---

When compiled with today's top of trunk (GCC 8.0) configured for x86_64-linux
--with-build-config=bootstrap-ubsan the following test case triggers a runtime
error in the check_mem_read_rtx() and all_positions_needed_p() functions in
dse.c.

$ cat t.c && gcc -O2 -S -Wall -ftracer t.c
typedef __SIZE_TYPE__ size_t;

extern void* memcpy (void* restrict, const void* restrict, size_t);

#define SSIZE_MAX   (__SIZE_MAX__ / 2)

void sink (void*);

void f (char *p, __SIZE_TYPE__ n)
{
  if (n < SSIZE_MAX - 2 || SSIZE_MAX < n)
n = SSIZE_MAX - 2;

  memcpy (p, p + n, 3);
}
/src/gcc/git/gcc/dse.c:2122:18: runtime error: signed integer overflow: 1 +
9223372036854775807 cannot be represented in type 'long int'
/src/gcc/git/gcc/dse.c:1252:61: runtime error: shift exponent -1 is negative

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

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

--- Comment #11 from rguenther at suse dot de  ---
On August 30, 2017 8:18:07 PM GMT+02:00, "dominiq at lps dot ens.fr"
 wrote:
>https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82005
>
>--- Comment #10 from Dominique d'Humieres 
>---
>I can prune the warnings with
>
>regsub -all "(^|\n)while processing\[^\n\]*" $text "" text
>regsub -all "(^|\n)warning: could not find referenced DIE" $text ""
>text
>
>however I see failures of the kind
>
>collect2: fatal error: dsymutil terminated with signal 11 [Segmentation
>fault:
>11]
>compilation terminated.

On LTO tescases or on others? LTO is expected to fail in weird ways until
simple object support for mach-o is implemented.

[Bug go/82043] New: error: redefinition of ...

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

Bug ID: 82043
   Summary: error: redefinition of ...
   Product: gcc
   Version: 7.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: go
  Assignee: ian at airs dot com
  Reporter: mfe at live dot de
CC: cmang at google dot com
  Target Milestone: ---

Created attachment 42088
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42088=edit
/usr/local/bin/make >

the exact version of GCC:
gcc-7.2.0

the system type:
NetgearReadyNAS Duo
(http://wiki.dietpc.org/index.php/DIET-PC_on_SPARC_ReadyNAS)

the options given when GCC was configured/built:
../gcc-7.2.0/configure CC=/opt/gcc-7.1/bin/gcc CXX=/opt/gcc-7.1/bin/g++
--enable-languages=c,c++,go --prefix=/opt/gcc-7.2.0  --with-cpu=v7
--disable-libstdcxx-pch --disable-linux-futex --disable-libsanitizer
--enable-__cxa_atexit --with-system-zlib --enable-nls --enable-clocale=gnu
--enable-debug  --disable-doc --disable-libcilkrts --disable-libitm


the complete command line that triggers the bug;
/usr/local/bin/make

the compiler output (error messages, warnings, etc.);
[...]
make[2]: Leaving directory
'/c/media/gcc-7.2.0-go/sparc-unknown-linux-gnu/libatomic'
make[2]: Entering directory
'/c/media/gcc-7.2.0-go/sparc-unknown-linux-gnu/libgo'
/usr/local/bin/make "AR_FLAGS=rc" "CC_FOR_BUILD=/opt/gcc-7.1/bin/gcc"
"CC_FOR_TARGET=/media/gcc-7.2.0-go/./gcc/xgcc -B/media/gcc-7.2.0-go/./gcc/"
"CFLAGS=-g -O2" "CXXFLAGS=-g -O2 -D_GNU_SOURCE" "CFLAGS_FOR_BUILD=-g -O2"
"CFLAGS_FOR_TARGET=-g -O2" "GOC_FOR_TARGET=/media/gcc-7.2.0-go/./gcc/gccgo
-B/media/gcc-7.2.0-go/./gcc/" "GOC=/media/gcc-7.2.0-go/./gcc/gccgo
-B/media/gcc-7.2.0-go/./gcc/ -B/opt/gcc-7.2.0/sparc-unknown-linux-gnu/bin/
-B/opt/gcc-7.2.0/sparc-unknown-linux-gnu/lib/ -isystem
/opt/gcc-7.2.0/sparc-unknown-linux-gnu/include -isystem
/opt/gcc-7.2.0/sparc-unknown-linux-gnu/sys-include   " "GOCFLAGS=-O2 -g"
"INSTALL=/usr/bin/install -c" "INSTALL_DATA=/usr/bin/install -c -m 644"
"INSTALL_PROGRAM=/usr/bin/install -c" "INSTALL_SCRIPT=/usr/bin/install -c"
"LDFLAGS=" "LIBCFLAGS=-g -O2" "LIBCFLAGS_FOR_TARGET=-g -O2"
"MAKE=/usr/local/bin/make" "MAKEINFO=makeinfo --split-size=500
--split-size=500 " "PICFLAG=" "PICFLAG_FOR_TARGET=" "SHELL=/bin/sh"
"RUNTESTFLAGS=" "exec_prefix=/opt/gcc-7.2.0"
"infodir=/opt/gcc-7.2.0/share/info" "libdir=/opt/gcc-7.2.0/lib"
"includedir=/opt/gcc-7.2.0/include" "prefix=/opt/gcc-7.2.0"
"tooldir=/opt/gcc-7.2.0/sparc-unknown-linux-gnu" "gxx_include_dir=" "AR=ar"
"AS=/media/gcc-7.2.0-go/./gcc/as" "LD=/media/gcc-7.2.0-go/./gcc/collect-ld"
"RANLIB=ranlib" "NM=/media/gcc-7.2.0-go/./gcc/nm" "NM_FOR_BUILD="
"NM_FOR_TARGET=nm" "DESTDIR=" "WERROR=-Werror" all-recursive
make[3]: Entering directory
'/c/media/gcc-7.2.0-go/sparc-unknown-linux-gnu/libgo'
make[4]: Entering directory
'/c/media/gcc-7.2.0-go/sparc-unknown-linux-gnu/libgo'
/bin/mkdir -p .; files=`echo ../../../gcc-7.2.0/libgo/go/runtime/alg.go
../../../gcc-7.2.0/libgo/go/runtime/cgo_gccgo.go
../../../gcc-7.2.0/libgo/go/runtime/cgocall.go
../../../gcc-7.2.0/libgo/go/runtime/chan.go
../../../gcc-7.2.0/libgo/go/runtime/compiler.go
../../../gcc-7.2.0/libgo/go/runtime/cpuprof.go
../../../gcc-7.2.0/libgo/go/runtime/cputicks.go
../../../gcc-7.2.0/libgo/go/runtime/debug.go
../../../gcc-7.2.0/libgo/go/runtime/env_posix.go
../../../gcc-7.2.0/libgo/go/runtime/error.go
../../../gcc-7.2.0/libgo/go/runtime/extern.go
../../../gcc-7.2.0/libgo/go/runtime/ffi.go
../../../gcc-7.2.0/libgo/go/runtime/hash32.go
../../../gcc-7.2.0/libgo/go/runtime/hashmap.go
../../../gcc-7.2.0/libgo/go/runtime/hashmap_fast.go
../../../gcc-7.2.0/libgo/go/runtime/heapdump.go
../../../gcc-7.2.0/libgo/go/runtime/iface.go
../../../gcc-7.2.0/libgo/go/runtime/lfstack.go
../../../gcc-7.2.0/libgo/go/runtime/lfstack_32bit.go
../../../gcc-7.2.0/libgo/go/runtime/lock_futex.go
../../../gcc-7.2.0/libgo/go/runtime/malloc.go
../../../gcc-7.2.0/libgo/go/runtime/mbarrier.go
../../../gcc-7.2.0/libgo/go/runtime/mbitmap.go
../../../gcc-7.2.0/libgo/go/runtime/mcache.go
../../../gcc-7.2.0/libgo/go/runtime/mcentral.go
../../../gcc-7.2.0/libgo/go/runtime/mem_gccgo.go
../../../gcc-7.2.0/libgo/go/runtime/mfinal.go
../../../gcc-7.2.0/libgo/go/runtime/mfixalloc.go
../../../gcc-7.2.0/libgo/go/runtime/mgc.go
../../../gcc-7.2.0/libgo/go/runtime/mgc_gccgo.go
../../../gcc-7.2.0/libgo/go/runtime/mgcmark.go
../../../gcc-7.2.0/libgo/go/runtime/mgcsweep.go
../../../gcc-7.2.0/libgo/go/runtime/mgcsweepbuf.go
../../../gcc-7.2.0/libgo/go/runtime/mgcwork.go
../../../gcc-7.2.0/libgo/go/runtime/mheap.go
../../../gcc-7.2.0/libgo/go/runtime/mprof.go
../../../gcc-7.2.0/libgo/go/runtime/msan0.go
../../../gcc-7.2.0/libgo/go/runtime/msize.go
../../../gcc-7.2.0/libgo/go/runtime/mstats.go
../../../gcc-7.2.0/libgo/go/runtime/netpoll.go
../../../gcc-7.2.0/libgo/go/runtime/netpoll_aix.go
../../../gcc-7.2.0/libgo/go/runtime/netpoll_epoll.go

[Bug tree-optimization/82042] signed integer overflow in ao_ref_init_from_ptr_and_size

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

Martin Sebor  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
  Known to fail||8.0

--- Comment #1 from Martin Sebor  ---
The code is valid but has undefined behavior, thus ice-on-valid-code.

[Bug tree-optimization/82042] New: signed integer overflow in ao_ref_init_from_ptr_and_size

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

Bug ID: 82042
   Summary: signed integer overflow in
ao_ref_init_from_ptr_and_size
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: msebor at gcc dot gnu.org
  Target Milestone: ---

When compiled with today's top of trunk (GCC 8.0) configured for x86_64-linux
--with-build-config=bootstrap-ubsan the following test case triggers a runtime
error in the ao_ref_init_from_ptr_and_size() function in tree-ssa-alias.c
(besides a number of others).

$ cat t.c && gcc -O2 -S -Wall -ftracer t.c

char *p;

extern char a[];

void f (int i)
{
  __SIZE_TYPE__ idx = __SIZE_MAX__ / 2 - 1;
  p = __builtin_stpcpy ([idx], i ? "123" : "12345");
}

/src/gcc/git/gcc/tree-ssa-alias.c:704:30: runtime error: signed integer
overflow: 9223372036854775806 * 8 cannot be represented in type 'long int'
/src/gcc/git/gcc/alias.c:2583:21: runtime error: signed integer overflow:
-9223372036854775806 - 9223372036854775806 cannot be represented in type 'long
int'
/src/gcc/git/gcc/cse.c:2195:10: runtime error: signed integer overflow:
-9223372036854775805 - 9223372036854775806 cannot be represented in type 'long
int'
/src/gcc/git/gcc/dse.c:932:38: runtime error: signed integer overflow:
9223372036854775806 + 4 cannot be represented in type 'long int'
/src/gcc/git/gcc/dse.c:1539:28: runtime error: signed integer overflow: 4 +
9223372036854775806 cannot be represented in type 'long int'

[Bug target/82041] New: Windows i686 should not return float aggregates in ST0

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

Bug ID: 82041
   Summary: Windows i686 should not return float aggregates in ST0
   Product: gcc
   Version: 7.2.0
Status: UNCONFIRMED
  Keywords: ABI, wrong-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jistone at redhat dot com
  Target Milestone: ---
Target: i686-w64-mingw32

This is nearly a clone of bug 82028, but it's less clear to me if it's actually
a real problem.  It may just be that gnu cdecl returns values differently than
msvc cdecl, especially since I see that clang alters behavior for the two
targets.

Given this input foo.c:

#include 
typedef struct { double x; } Foo;
Foo foo(Foo f) {
f.x = fabs(f.x);
return f;
}

mingw-gcc produces code that returns in ST0:

 <_foo>:
   0:   55  push   %ebp
   1:   89 e5   mov%esp,%ebp
   3:   83 ec 08sub$0x8,%esp
   6:   8b 45 08mov0x8(%ebp),%eax
   9:   89 45 f8mov%eax,-0x8(%ebp)
   c:   8b 45 0cmov0xc(%ebp),%eax
   f:   89 45 fcmov%eax,-0x4(%ebp)
  12:   dd 45 f8fldl   -0x8(%ebp)
  15:   d9 e1   fabs
  17:   dd 5d f8fstpl  -0x8(%ebp)
  1a:   dd 45 f8fldl   -0x8(%ebp)
  1d:   c9  leave
  1e:   c3  ret

MSVC returns in EDX:EAX:

 <_foo>:
   0:   55  push   %ebp
   1:   8b ec   mov%esp,%ebp
   3:   83 ec 08sub$0x8,%esp
   6:   f2 0f 10 45 08  movsd  0x8(%ebp),%xmm0
   b:   f2 0f 11 04 24  movsd  %xmm0,(%esp)
  10:   e8 00 00 00 00  call   15 <_foo+0x15>
  15:   83 c4 08add$0x8,%esp
  18:   dd 5d 08fstpl  0x8(%ebp)
  1b:   8b 45 08mov0x8(%ebp),%eax
  1e:   8b 55 0cmov0xc(%ebp),%edx
  21:   5d  pop%ebp
  22:   c3  ret

Clang for i686-w64-windows-gnu returns in ST0 like GCC:

 <_foo>:
   0:   55  push   %ebp
   1:   89 e5   mov%esp,%ebp
   3:   83 e4 f8and$0xfff8,%esp
   6:   83 ec 18sub$0x18,%esp
   9:   f2 0f 10 45 08  movsd  0x8(%ebp),%xmm0
   e:   f2 0f 11 44 24 08   movsd  %xmm0,0x8(%esp)
  14:   f2 0f 10 44 24 08   movsd  0x8(%esp),%xmm0
  1a:   0f 28 0d 00 00 00 00movaps 0x0,%xmm1
  21:   66 0f db c1 pand   %xmm1,%xmm0
  25:   66 0f 13 44 24 08   movlpd %xmm0,0x8(%esp)
  2b:   f2 0f 10 44 24 08   movsd  0x8(%esp),%xmm0
  31:   f2 0f 11 44 24 10   movsd  %xmm0,0x10(%esp)
  37:   f2 0f 10 44 24 10   movsd  0x10(%esp),%xmm0
  3d:   f2 0f 11 04 24  movsd  %xmm0,(%esp)
  42:   dd 04 24fldl   (%esp)
  45:   89 ec   mov%ebp,%esp
  47:   5d  pop%ebp
  48:   c3  ret

Clang for i686-w64-windows-msvc returns in EDX:EAX like MSVC:

 <_foo>:
   0:   55  push   %ebp
   1:   89 e5   mov%esp,%ebp
   3:   83 e4 f8and$0xfff8,%esp
   6:   83 ec 10sub$0x10,%esp
   9:   f2 0f 10 45 08  movsd  0x8(%ebp),%xmm0
   e:   f2 0f 11 04 24  movsd  %xmm0,(%esp)
  13:   f2 0f 10 04 24  movsd  (%esp),%xmm0
  18:   0f 28 0d 00 00 00 00movaps 0x0,%xmm1
  1f:   66 0f db c1 pand   %xmm1,%xmm0
  23:   66 0f 13 04 24  movlpd %xmm0,(%esp)
  28:   f2 0f 10 04 24  movsd  (%esp),%xmm0
  2d:   f2 0f 11 44 24 08   movsd  %xmm0,0x8(%esp)
  33:   8b 44 24 08 mov0x8(%esp),%eax
  37:   8b 54 24 0c mov0xc(%esp),%edx
  3b:   89 ec   mov%ebp,%esp
  3d:   5d  pop%ebp
  3e:   c3  ret


$ gcc -v
Using built-in specs.
COLLECT_GCC=C:\msys64\mingw32\bin\gcc.exe
COLLECT_LTO_WRAPPER=C:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/7.2.0/lto-wrapper.exe
Target: i686-w64-mingw32
Configured with: ../gcc-7.2.0/configure --prefix=/mingw32
--with-local-prefix=/mingw32/local --build=i686-w64-mingw32
--host=i686-w64-mingw32 --target=i686-w64-mingw32
--with-native-system-header-dir=/mingw32/i686-w64-mingw32/include
--libexecdir=/mingw32/lib --enable-bootstrap --with-arch=i686
--with-tune=generic --enable-languages=c,lto,c++,objc,obj-c++,fortran,ada
--enable-shared --enable-static --enable-libatomic --enable-threads=posix
--enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-time=yes
--disable-libstdcxx-pch --disable-libstdcxx-debug --disable-isl-version-check
--enable-lto --enable-libgomp --disable-multilib --enable-checking=release

[Bug tree-optimization/81987] [8 Regression] ICE in verify_ssa with -O3 -march=skylake-avx512

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

--- Comment #6 from Bill Schmidt  ---
Patch submitted here:  https://gcc.gnu.org/ml/gcc-patches/2017-08/msg01743.html

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

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

--- Comment #2 from Dennis Clarke  ---
Seems to be a 32-bit PowerPC ELF :

ppc64$ ls -lap /usr/bin/ld
lrwxrwxrwx 1 root root 6 Jan 12  2017 /usr/bin/ld -> ld.bfd

ppc64$ ls -lap /usr/bin/ld.bfd
-rwxr-xr-x 1 root root 700284 Jan 12  2017 /usr/bin/ld.bfd

ppc64$ file  /usr/bin/ld.bfd
/usr/bin/ld.bfd: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1
(SYSV), dynamically linked, interpreter /lib/ld.so.1, for GNU/Linux 2.6.32,
BuildID[sha1]=bf837c229beabc8073b38307339991ed9a58418a, stripped

Not sure how that helps.

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

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

--- Comment #10 from Dominique d'Humieres  ---
I can prune the warnings with

regsub -all "(^|\n)while processing\[^\n\]*" $text "" text
regsub -all "(^|\n)warning: could not find referenced DIE" $text "" text

however I see failures of the kind

collect2: fatal error: dsymutil terminated with signal 11 [Segmentation fault:
11]
compilation terminated.

[Bug target/82015] PowerPC should check if 2nd argument to __builtin_unpackv1ti and similar functions is 0 or 1

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

--- Comment #2 from Michael Meissner  ---
Author: meissner
Date: Wed Aug 30 18:09:51 2017
New Revision: 251539

URL: https://gcc.gnu.org/viewcvs?rev=251539=gcc=rev
Log:
2017-08-30  Michael Meissner  

PR target/82015
* gcc.target/powerpc/pr82015.c: Fix up error message.


Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.target/powerpc/pr82015.c

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

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

Bug ID: 82040
   Summary: ICE with -Wbool-operation and ~
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jorrit at jorrit dot de
  Target Milestone: ---

The following code, when compiled with

  g++ -std=c++11 -Wbool-operation standardtest_bool.ii -S -o /dev/null

results in the following ICE:

  Internal compiler error: Error reporting routines re-entered.

standardtest_bool.ii:

template  decltype(~c{}) call() { return ~false; }
template int call();


This does not happen without -Wbool-operation.

This was originally observed with "g++-7 (Debian 7.1.0-9) 7.1.0" from Debian
testing (buster).

According to https://godbolt.org/g/pYgpua, this is still present in "g++
(GCC-Explorer-Build) 8.0.0 20170830 (experimental)"

g++-6 does not seem to have -Wbool-operation, so this does not apply.

Here is the full output, obtained with g++-7 from Debian testing (godbolt
seems to suppress the backtrace):

-*- mode: compilation; default-directory:
"/builds/core/dune-common/build-cmake/dune/common/simd/test/gcc-6/hand/" -*-
Compilation started at Wed Aug 30 17:13:07

/usr/bin/g++-7 -std=c++11 -Wbool-operation standardtest_bool.ii -S -o /dev/null
standardtest_bool.ii: In function 'decltype (~ c{}) call()':
standardtest_bool.ii:1:52: warning: '~' on an expression of type bool
[-Wbool-operation]
 template  decltype(~c{}) call() { return ~false; }
^
standardtest_bool.ii:1:52: note: did you mean to use logical not ('!')?
standardtest_bool.ii: In substitution of 'template decltype (~ c{})
call() [with c = bool]':
standardtest_bool.ii:2:25:   required from here
standardtest_bool.ii:1:29: warning: '~' on an expression of type bool
[-Wbool-operation]
 template  decltype(~c{}) call() { return ~false; }
 ^~~~
standardtest_bool.ii:1:29: note: did you mean to use logical not ('!')?
standardtest_bool.ii: In substitution of 'template decltype (~ c{})
call() [with c = bool]':
standardtest_bool.ii:2:25:   required from here
standardtest_bool.ii:1:29: warning: '~' on an expression of type bool
[-Wbool-operation]
standardtest_bool.ii:1:29: note: did you mean to use logical not ('!')?
standardtest_bool.ii: At global scope:
standardtest_bool.ii:1:29: warning: '~' on an expression of type bool
[-Wbool-operation]
standardtest_bool.ii:1:29: note: did you mean to use logical not ('!')?
'
Internal compiler error: Error reporting routines re-entered.
0x668771 cp_build_unary_op(tree_code, tree_node*, bool, int)
../../src/gcc/cp/typeck.c:5930
0x5b252f build_new_op_1
../../src/gcc/cp/call.c:5995
0x5b2f6e build_new_op(unsigned int, tree_code, int, tree_node*, tree_node*,
tree_node*, tree_node**, int)
../../src/gcc/cp/call.c:6026
0x66738f build_x_unary_op(unsigned int, tree_code, cp_expr, int)
../../src/gcc/cp/typeck.c:5425
0x5ee034 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
../../src/gcc/cp/pt.c:16876
0x5e28d5 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
../../src/gcc/cp/pt.c:14143
0x5e28d5 tsubst(tree_node*, tree_node*, int, tree_node*)
../../src/gcc/cp/pt.c:14143
0x620982 dump_template_bindings
../../src/gcc/cp/error.c:353
0x620982 dump_substitution
../../src/gcc/cp/error.c:1494
0x621242 dump_substitution
../../src/gcc/cp/cp-tree.h:5572
0x621242 dump_function_decl
../../src/gcc/cp/error.c:1649
0x6263e1 decl_to_string
../../src/gcc/cp/error.c:3033
0x6263e1 cp_printer
../../src/gcc/cp/error.c:3610
0x11c01a2 pp_format(pretty_printer*, text_info*)
../../src/gcc/pretty-print.c:679
0x11c0a10 pp_format_verbatim(pretty_printer*, text_info*)
../../src/gcc/pretty-print.c:738
0x11c0ae4 pp_verbatim(pretty_printer*, char const*, ...)
../../src/gcc/pretty-print.c:939
0x61fa85 print_instantiation_full_context
../../src/gcc/cp/error.c:3388
0x624a68 maybe_print_instantiation_context
../../src/gcc/cp/error.c:3536
0x624a68 cp_diagnostic_starter
../../src/gcc/cp/error.c:3229
0x11b983e diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*)
../../src/gcc/diagnostic.c:962
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

Compilation exited abnormally with code 1 at Wed Aug 30 17:13:07


Convenience link to our bug:
https://gitlab.dune-project.org/core/dune-common/issues/84

[Bug testsuite/81690] libgomp.c/{target-32,thread-limit-2}.c fail for nvptx: missing usleep

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

--- Comment #3 from Thomas Schwinge  ---
(In reply to Thomas Schwinge from comment #2)
> Per PTX 3.1, "Table 141. Special Registers: %clock", "Special register
> %clock is an unsigned 32-bit read-only cycle counter that wraps silently",

Probably not too useful for implementing "usleep":
,
.

> which possibly could be used to implemented "usleep" (in newlib)?  For that,
> we'd first have to figure out what a "cycle" is.  Quite possibly, this will
> be different per hardware architecture, so would need some newlib/libgcc
> startup code.  Possibly it might also depend on the actual clock speed at
> run time, which would make this more/too much convoluted, if at all
> practical?
> 
> (Best to avoid such "sleep" function usage, of course.)  ;-)

[Bug testsuite/81690] libgomp.c/{target-32,thread-limit-2}.c fail for nvptx: missing usleep

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

Thomas Schwinge  changed:

   What|Removed |Added

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

--- Comment #2 from Thomas Schwinge  ---
Per PTX 3.1, "Table 141. Special Registers: %clock", "Special register %clock
is an unsigned 32-bit read-only cycle counter that wraps silently", which
possibly could be used to implemented "usleep" (in newlib)?  For that, we'd
first have to figure out what a "cycle" is.  Quite possibly, this will be
different per hardware architecture, so would need some newlib/libgcc startup
code.  Possibly it might also depend on the actual clock speed at run time,
which would make this more/too much convoluted, if at all practical?

(Best to avoid such "sleep" function usage, of course.)  ;-)

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

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

Bug ID: 82039
   Summary: -Wzero-as-null-pointer-constant triggers when calling
std::allocate<...>::allocate
   Product: gcc
   Version: 7.1.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: max at maxbruckner dot de
  Target Milestone: ---

Created attachment 42087
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42087=edit
Code to reproduce the problem

gcc 7.1.1 emits a warning when enabling -Wzero-as-null-pointer-constant and
calling the allocate member function of std::allocator provided by libstdc++.

This only happens when calling allocate with only one parameter. So a
workaround is calling it with the second parameter set to nullptr.

I think this is due to the default parameter for the second parameter being a 0
instead of nullptr (not sure though, since I couldn't find the actual
implementation in the header files.

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

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

--- Comment #9 from Dominique d'Humieres  ---
> If you manually do the extraction / renaming and link with the early
> debug part it should work(?)  (I didn't try myself, doing this
> manually might be a bit tricky -- look at the compile assembler,
> remove the DWARF segment and rename the GNU_DWARF_LTO segment to
> DWARF, remove all text and data sections and assemble.

If I do that, I get

% /opt/gcc/gcc8w/bin/gcc sinus.s -g -flto ccalucJK.ltrans0.s
duplicate symbol _main in:
/var/folders/8q/sh_swgz96r7f5vnn08f7fxr0gn/T//ccdfehYe.o
/var/folders/8q/sh_swgz96r7f5vnn08f7fxr0gn/T//cctL4UNA.o
ld: 1 duplicate symbol for architecture x86_64
collect2: error: ld returned 1 exit status

[Bug libgomp/81886] Means to determine at runtime foffload targets specified at compile time

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

Thomas Schwinge  changed:

   What|Removed |Added

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

--- Comment #6 from Thomas Schwinge  ---
... a.k.a. the old issue discussed in long threads with subject: "Forwarding
-foffload=[...] from the driver (compile-time) to libgomp (run-time)" and "Pass
-foffload targets from driver to libgomp at link time".  The discussion
eventually concluded in an approach approved by Jakub -- which still needs to
be implemented, which I'd like to do eventually, but it's not gotten anything
near high priority.

[Bug fortran/82036] Recursive allocatable class components cause infinite loop in compilation

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

Richard Biener  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED

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

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

--- Comment #1 from Richard Biener  ---
Your host linker isn't ppc64?

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

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

--- Comment #8 from rguenther at suse dot de  ---
On Wed, 30 Aug 2017, dominiq at lps dot ens.fr wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82005
> 
> --- Comment #7 from Dominique d'Humieres  ---
> With the patch in comment 6, compiling the test in comment 0 with -g -flto
> gives
> 
> while processing
> /var/folders/8q/sh_swgz96r7f5vnn08f7fxr0gn/T//ccqniUp8.ltrans0.ltrans.o:
> warning: could not find referenced DIE
> while processing
> /var/folders/8q/sh_swgz96r7f5vnn08f7fxr0gn/T//ccqniUp8.ltrans0.ltrans.o:
> warning: could not find referenced DIE
> while processing
> /var/folders/8q/sh_swgz96r7f5vnn08f7fxr0gn/T//ccqniUp8.ltrans0.ltrans.o:
> warning: could not find referenced DIE
> while processing
> /var/folders/8q/sh_swgz96r7f5vnn08f7fxr0gn/T//ccqniUp8.ltrans0.ltrans.o:
> warning: could not find referenced DIE

I guess that's expected given the missing implementation of simple-objects
copy_lto_debug_sections for Mach-O.

If you manually do the extraction / renaming and link with the early
debug part it should work(?)  (I didn't try myself, doing this
manually might be a bit tricky -- look at the compile assembler,
remove the DWARF segment and rename the GNU_DWARF_LTO segment to
DWARF, remove all text and data sections and assemble.

[Bug middle-end/81724] ICE in expand_stack_vars

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

Thomas Schwinge  changed:

   What|Removed |Added

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

--- Comment #2 from Thomas Schwinge  ---
I once (months ago, and only very briefly) looked into this; here are my notes,
if that's helpful -- probably not too much.  ;-)

If I'm now reading my notes correctly, this appeared with trunk r238432
"Allocate constant size dynamic stack space in the prologue",
.

$ build-gcc/gcc/xgcc -Bbuild-gcc/gcc/
source-gcc/gcc/testsuite/gcc.dg/stack-layout-dynamic-1.c
-fno-diagnostics-show-caret -fdiagnostics-color=never
--sysroot=install/nvptx-none -O0 -fomit-frame-pointer -DSTACK_SIZE=8192
-DNO_TRAMPOLINES -DNO_LABEL_VALUES -DSIGNAL_SUPPRESS -S -isystem
build-gcc/nvptx-none/./newlib/targ-include -isystem
source-gcc/newlib/libc/include -o stack-layout-dynamic-1.s

$ build-gcc/gcc/xgcc -Bbuild-gcc/gcc/
source-gcc/gcc/testsuite/gcc.dg/stack-layout-dynamic-1.c -O0
-fomit-frame-pointer -S
[...]/source-gcc/gcc/testsuite/gcc.dg/stack-layout-dynamic-1.c: In function
'foo':
[...]/source-gcc/gcc/testsuite/gcc.dg/stack-layout-dynamic-1.c:7:6:
internal compiler error: RTL check: expected code 'const_int', have 'reg' in
expand_stack_vars, at cfgexpand.c:1196
0xaa7607 rtl_check_failed_code1(rtx_def const*, rtx_code, char const*, int,
char const*)
[...]/source-gcc/gcc/rtl.c:811
0x6a2c42 expand_stack_vars
[...]/source-gcc/gcc/cfgexpand.c:1196
0x6b1146 expand_used_vars
[...]/source-gcc/gcc/cfgexpand.c:2251
0x6b2a60 execute
[...]/source-gcc/gcc/cfgexpand.c:6237

$ build-gcc-offload-nvptx-none/gcc/xgcc -Bbuild-gcc-offload-nvptx-none/gcc/
source-gcc/gcc/testsuite/gcc.dg/stack-layout-dynamic-1.c -O0
-fomit-frame-pointer -S

#0  internal_error (gmsgid=gmsgid@entry=0x1219800 "RTL check: expected code
'%s', have '%s' in %s, at %s:%d") at [...]/source-gcc/gcc/diagnostic.c:1335
#1  0x00abfb48 in rtl_check_failed_code1 (r=r@entry=0x769c9ac8,
code=, code@entry=CONST_INT, file=,
file@entry=0x11b6a58 "[...]/source-gcc/gcc/cfgexpand.c", line=,
line@entry=1198, func=, func@entry=0x11b85b0

"expand_stack_vars") at [...]/source-gcc/gcc/rtl.c:811
#2  0x006b6bc2 in expand_stack_vars (pred=pred@entry=0x0,
data=data@entry=0x7fffcb50) at [...]/source-gcc/gcc/cfgexpand.c:1198
#3  0x006c5cf7 in expand_used_vars () at
[...]/source-gcc/gcc/cfgexpand.c:2253
#4  0x006c6252 in (anonymous namespace)::pass_expand::execute
(this=0x16d3be0, fun=0x76982b28) at [...]/source-gcc/gcc/cfgexpand.c:6239
#5  0x00a4942d in execute_one_pass (pass=pass@entry=0x16d3be0) at
[...]/source-gcc/gcc/passes.c:2344
#6  0x00a49a48 in execute_pass_list_1 (pass=0x16d3be0) at
[...]/source-gcc/gcc/passes.c:2428
#7  0x00a49aa5 in execute_pass_list (fn=0x76982b28,
pass=) at [...]/source-gcc/gcc/passes.c:2439
#8  0x0070283d in cgraph_node::expand
(this=this@entry=0x769c6000) at [...]/source-gcc/gcc/cgraphunit.c:1983
#9  0x00704274 in expand_all_functions () at
[...]/source-gcc/gcc/cgraphunit.c:2119
#10 symbol_table::compile (this=this@entry=0x768d2000) at
[...]/source-gcc/gcc/cgraphunit.c:2477
#11 0x0070646a in symbol_table::finalize_compilation_unit
(this=0x768d2000) at [...]/source-gcc/gcc/cgraphunit.c:2567
#12 0x00b12fcd in compile_file () at
[...]/source-gcc/gcc/toplev.c:490
#13 0x0055074b in do_compile () at
[...]/source-gcc/gcc/toplev.c:1998
#14 toplev::main (this=this@entry=0x7fffcf20, argc=argc@entry=20,
argv=argv@entry=0x7fffd028) at [...]/source-gcc/gcc/toplev.c:2132
#15 0x00552407 in main (argc=20, argv=0x7fffd028) at
[...]/source-gcc/gcc/main.c:39

(gdb) frame 2
#2  0x006b6bc2 in expand_stack_vars (pred=pred@entry=0x0,
data=data@entry=0x7fffcb50) at [...]/source-gcc/gcc/cfgexpand.c:1198
1198(INTVAL (large_allocsize),
(gdb) list
1193  rtx large_allocsize;
1194
1195  large_allocsize = GEN_INT (large_size);
1196  get_dynamic_stack_size (_allocsize, 0,
large_align, NULL);
1197  loffset = alloc_stack_frame_space
1198(INTVAL (large_allocsize),
1199 PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT);
1200  large_base = get_dynamic_stack_base (loffset,
large_align);
1201

[Bug libfortran/81939] valgrind error message in build_float_string and heap-buffer-overflow on address sanitized libgfortran.so

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

--- Comment #3 from Dominique d'Humieres  ---
> Did you get MALLOC checks?
>
> *** Error in `./a.out': free(): invalid pointer: 0x00c0b560 ***
> *** Error in `./a.out': free(): invalid pointer: 0x00c0b6a0 ***
> *** Error in `./a.out': free(): invalid pointer: 0x00c0c9f0 ***
>
> I have MALLOC_CHECK_=1

I am not sure MALLOC_CHECK_ is doing anything on darwin and I cannot use
valgrind anymore.

[Bug target/82038] Very poor optimization of constant multiply on ARM Cortex-M7

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

--- Comment #2 from Christopher Head  ---
I think they do. Just one example, but I’m pretty sure it holds for others too
(left-shift equals multiply by power of two, even for negative integers; it’s
right-shift where the behaviour differs due to different rounding):

== On entry ==
r0 = -16 = 0xFFF0

== f ==
0:
2: r5 = r0 ASR 31 = 0x
4: r3 = r0 = 0xFFF0
6: r0 = r0 << 14 = 0xFFFC
8: r1 = r5 << 14 = 0xC000
a:
c: r1 = r1 | (r3 LSR 18)
= 0xC000 | (0xFFF0 LSR 18)
= 0xC000 | 0x3FFF
= 0x

On exit, r1:r0 = 0x : 0xFFFC = -262,144

== g ==
14: r1 = r0 = 0xFFF0
16: r0 = r0 << 14 = 0xFFFC
18: r1 = r1 ASR 18 = 0x

On exit, r1:r0 = 0x : 0xFFFC = -262,144

[Bug target/82038] Very poor optimization of constant multiply on ARM Cortex-M7

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

--- Comment #1 from Andrew Pinski  ---
I don't think these two assembly code gives the same output if x was negative.

[Bug target/82038] New: Very poor optimization of constant multiply on ARM Cortex-M7

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

Bug ID: 82038
   Summary: Very poor optimization of constant multiply on ARM
Cortex-M7
   Product: gcc
   Version: 7.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: headch at gmail dot com
  Target Milestone: ---

Consider the following source code:

#include 

int64_t f(int32_t x) {
return x * 16384LL;
}

int64_t g(int32_t x) {
return static_cast(x) << 14;
}

Compile it with the following command:

armv7m-none-eabihf-g++ -ffreestanding -Wall -Wextra -O2 -mcpu=cortex-m7
-std=c++17 -c test.cpp

It produces the following code:

 <_Z1fl>:
   0:   b430push{r4, r5}
   2:   17c5asrsr5, r0, #31
   4:   4603mov r3, r0
   6:   0380lslsr0, r0, #14
   8:   03a9lslsr1, r5, #14
   a:   bc30pop {r4, r5}
   c:   ea41 4193   orr.w   r1, r1, r3, lsr #18
  10:   4770bx  lr
  12:   bf00nop

0014 <_Z1gl>:
  14:   4601mov r1, r0
  16:   0380lslsr0, r0, #14
  18:   1489asrsr1, r1, #18
  1a:   4770bx  lr

The implementation of f could be the same as g, yet it’s really quite awful.

Changing -mcpu=cortex-m7 to -mcpu=cortex-m4 doesn’t affect g. It yields rather
better code for f than the M7 build, but still not as good as g.

I could just use g, but that isn’t really a good option because left-shifting a
negative number is UB.

[Bug libfortran/81984] NULL string pointer dereferencing forces undefined behaviour in libgfortran

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

--- Comment #4 from Vittorio Zecca  ---
There is no core dump because by default the ubsan sanitizer does not abort.

But I am pretty sure len1==0 at that point.

[Bug libfortran/81939] valgrind error message in build_float_string and heap-buffer-overflow on address sanitized libgfortran.so

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

--- Comment #2 from Vittorio Zecca  ---
Did you get MALLOC checks?

*** Error in `./a.out': free(): invalid pointer: 0x00c0b560 ***
*** Error in `./a.out': free(): invalid pointer: 0x00c0b6a0 ***
*** Error in `./a.out': free(): invalid pointer: 0x00c0c9f0 ***

I have MALLOC_CHECK_=1

[Bug fortran/82018] -Wextra should imply -Wconversion-extra

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

--- Comment #11 from janus at gcc dot gnu.org ---
(In reply to Dominique d'Humieres from comment #8)
> Exactly what I feared in comment 4!-(the time taken by this PR is not
> devoted to more important ones, e.g., final review for Paul's patch PR34640).

Well, Dominique, I don't really know what to reply to this ...

I appreciate the fact that you're worried about the overall progress of
gfortran, and I do share that mindset. Moreover, I certainly don't want to
doubt that Paul is doing great and important work there (as always), and it
dearly deserves someone to review it.

However, quite honestly, as a volunteer contributor to an open-source project,
I guess I'm free to choose whether I want to contribute at all, and when and
how to contribute. I'm sure my priorities don't always match yours or that of
other people, but yes, believe it or not, right now this PR here is an issue to
me, so I choose to devote some of my spare time to it, because it scratches a
personal itch. Not much more to say.

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

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

Bug ID: 82037
   Summary: powerpc64-unknown-linux-gnu bootstrap breaks in stage2
with gcc/liblto_plugin.so: wrong ELF class: ELFCLASS64
   Product: gcc
   Version: 7.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: bootstrap
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dclarke at blastwave dot org
  Target Milestone: ---

Debian 8.8 on powerpc64-unknown-linux-gnu thus : 

ppc64$ ../gcc-7.2.0/config.guess 
powerpc64-unknown-linux-gnu
ppc64$ 

ppc64$ uname -a 
Linux charon 3.16.0-4-powerpc64 #1 SMP Debian 3.16.43-2 (2017-04-30) ppc64
GNU/Linux
ppc64$ 

configure looked good : 

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=970 --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 Wed Aug 30 02:32:29 UTC 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... no
checking for gcc... gcc
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 accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for powerpc64-unknown-linux-gnu-g++... no
checking for powerpc64-unknown-linux-gnu-c++... no
checking for powerpc64-unknown-linux-gnu-gpp... no
checking for powerpc64-unknown-linux-gnu-aCC... no
checking for powerpc64-unknown-linux-gnu-CC... no
checking for powerpc64-unknown-linux-gnu-cxx... no
checking for powerpc64-unknown-linux-gnu-cc++... no
checking for powerpc64-unknown-linux-gnu-cl.exe... no
checking for powerpc64-unknown-linux-gnu-FCC... no
checking for powerpc64-unknown-linux-gnu-KCC... no
checking for powerpc64-unknown-linux-gnu-RCC... no
checking for powerpc64-unknown-linux-gnu-xlC_r... no
checking for powerpc64-unknown-linux-gnu-xlC... no
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ 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 

[Bug fortran/82018] -Wextra should imply -Wconversion-extra

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

--- Comment #10 from janus at gcc dot gnu.org ---
(In reply to Thomas Koenig from comment #6)
> -Wconversion-extra uncovers lots of things that people may not want to
> see a warning about, such as i8=i4.
> 
> We had a lengthy discussion about this in 2015, with the current
> implementation as the result.
> 
> See https://gcc.gnu.org/ml/fortran/2015-05/msg00176.html and
> followups for the discussions about this.

I actually agree with most of this discussion, but it does not really discuss
the question whether -Wconversion-extra should be included in -Wextra.

[Bug fortran/82018] -Wextra should imply -Wconversion-extra

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

--- Comment #9 from janus at gcc dot gnu.org ---
(In reply to Thomas Koenig from comment #7)
> I expect strong negative feedback if -Wextra starts emitting
> lots of warnings about code which is not problematic.

Well, a few points here:
1) gfortran has been including these kinds of messages even with -Wall until
version 5, so having them in -Wextra is probably not too bad.
2) They may be considered useful by some people (me for example), even though
not by everyone.
3) In my understanding -Wextra is a collection of warning messages that may not
be considered useful for everyone, while -Wall is a collection that is expected
to be useful for most people (i.e. a useful default in terms of warnings). To
my mind moving -Wconversion-extra from -Wall to -Wextra is a reasonable
approach.

[Bug target/81907] memset called when it does not need to be; -mtune=cortex-a9

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

--- Comment #17 from Michail  ---

> I think that for this example GCC 7 generates memset() call after changes in
> tree-ssa-dse

I mean GCC 6 generates memset()

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

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

--- Comment #7 from Dominique d'Humieres  ---
With the patch in comment 6, compiling the test in comment 0 with -g -flto
gives

while processing
/var/folders/8q/sh_swgz96r7f5vnn08f7fxr0gn/T//ccqniUp8.ltrans0.ltrans.o:
warning: could not find referenced DIE
while processing
/var/folders/8q/sh_swgz96r7f5vnn08f7fxr0gn/T//ccqniUp8.ltrans0.ltrans.o:
warning: could not find referenced DIE
while processing
/var/folders/8q/sh_swgz96r7f5vnn08f7fxr0gn/T//ccqniUp8.ltrans0.ltrans.o:
warning: could not find referenced DIE
while processing
/var/folders/8q/sh_swgz96r7f5vnn08f7fxr0gn/T//ccqniUp8.ltrans0.ltrans.o:
warning: could not find referenced DIE

[Bug target/81907] memset called when it does not need to be; -mtune=cortex-a9

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

Michail  changed:

   What|Removed |Added

 CC||m.kashkarov at partner dot 
samsung
   ||.com

--- Comment #16 from Michail  ---
> Agreed, but, I'm just wondering why it has diffrent behavior according by
> GCC version with -Os. (It should be same result if the choice is made by
> their instructions and costs)

I think that for this example GCC 7 generates memset() call after changes in
tree-ssa-dse
https://gcc.gnu.org/viewcvs/gcc?limit_changes=0=revision=22
(tuning is the same)

for reduced test:
$ cat memset_test_reduced.c
long long func1( long long *pl) 
{
  long  long  r = 0;
  for(int i=0; i<2; i++)
r += ( long long ) pl[i];
  return r;
}

long long test_func(void) 
{
  long long x[2] = {0};
  x[0] = 3;
  x[1] = 4;
  return func1(x);
}

compiled with:
gcc -S memset_test_reduced.c -g -mabi=aapcs -fno-function-sections -Wall
-mfloat-abi=soft -Os -mtune=cortex-a9 -fdump-tree-all

Difference between GIMPLE produced by gcc-6.4.1 and gcc-7.2.1 is that gcc-7
optimized out "x = {};" in first DSE pass:

diff -u 6.4.1/memset_test_reduced.c.210t.optimized 
7.2.1/memset_test_reduced.c.227t.optimized
...
test_func ()
 {
   long long int x[2];
-  long long int _5;
+  long long int _4;

-  :
==
-  x = {};
==
+   [100.00%]:
   x[0] = 3;
   x[1] = 4;
-  _5 = func1 ();
+  _4 = func1 ();
   x ={v} {CLOBBER};
-  return _5;
+  return _4;
}

Gcc-6 keeps it and transforms in memset() (according to tune options?) after
all.

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

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

--- Comment #22 from Dennis Clarke  ---
I think Rainer's patch as well as the addition of the env vars that
point to "gobjcopy" and "gobjdump" have sorted this out. I get a 
clean three stage bootstrap now on an sparc-sun-solaris2.10 arch
which is an Oracle SPARC M4000 server.  I don't think the SPARC64-VII+
type processors will make a difference as all the output ELF files are
clearly portable to the EF_SPARCV9_TSO per the ELF header e_flags.
I can try again on a few other sparc servers to verify but at the
moment this looks resolved with the added dummy .text section for
an empty input file to the platform assembler as. 

However the testsuite still fails.  For now at least.

Dennis Clarke

[Bug libstdc++/82033] C++11 library doesn't work on AIX if GCC is built with --disable-bootstrap

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

--- Comment #4 from Sam Thursfield  ---
For posterity, the actual cause of my issue was passing `--disable-multilib` to
configure. It's pretty clear why this broke some threading stuff -- 'pthread'
is a whole separate set of libs on AIX.

[Bug target/82034] SMMLAR pattern not detected on ARMv7-M

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

--- Comment #2 from Oscar Molin  ---
(In reply to Richard Biener from comment #1)
> Can you please quote the typedefs for q31_t and q63_t, specify the GCC
> version you tested and provide a full testcase that can be compiled?

I made a program recreating this in GCC 7.1 (Arch repo, arm-none-eabi-gcc).
See that three variants included, I wasnt sure which useage of __SMMLAR was
right. I used the second one in my application, but I don't know if it's
required to have a return value to get the same result.

Compilation options:
arm-none-eabi-gcc -O3 smmlar.c -o test.elf -mcpu=cortex-m4 -mthumb
-mfpu=fpv4-sp-d16 --std=c11 --specs=nosys.specs

Dump assembly:
arm-none-eabi-objdump -D test.elf > test.dump

Code (smmlar.c):

#include 

typedef int32_t q31_t;
typedef int64_t q63_t;
#define __STATIC_INLINE static inline
#define __ASM __asm

#define multAcc_32x32_keep32_R(a, x, y) \
a = (q31_t) (q63_t) a) << 32) + ((q63_t) x * y) + 0x8000LL ) >> 32)

__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMMLAR (int32_t
op1, int32_t op2, int32_t op3)
{
 int32_t result;

 __ASM volatile ("smmlar %0, %1, %2, %3" : "=r" (result): "r"  (op1), "r"
(op2), "r" (op3) );
 return(result);
}


int main()
{
  volatile int a = 1, b = 2, c = 3;

  q31_t acc0 = a;
  q31_t x0   = b;
  q31_t c0   = c;


  //Original call used in CMSIS-DSP
  //multAcc_32x32_keep32_R(acc0, x0, c0);

  // 
  __SMMLAR(x0, c0, acc0);

  // Alternative form?
  //acc0 = __SMMLAR(x0, c0, acc0);

  return acc0; 
}

[Bug fortran/82036] Recursive allocatable class components cause infinite loop in compilation

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

Paul Thomas  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-08-30
   Assignee|unassigned at gcc dot gnu.org  |pault at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Paul Thomas  ---
Taking it

Paul

[Bug fortran/82036] New: Recursive allocatable class components cause infinite loop in compilation

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

Bug ID: 82036
   Summary: Recursive allocatable class components cause infinite
loop in compilation
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: pault at gcc dot gnu.org
  Target Milestone: ---

Reported on clf by Ev. Drikos

type t6
   integer :: i
   class(t6), allocatable :: foo
end type t6
type(t6) :: x

x = t6(42, t6(99,NULL()))

print *, "hello", x%foo%i

end

causes an infinite compiler loop. Replacing CLASS with TYPE in the component
declaration removes the problem.

I will take it.

Paul

[Bug c++/82035] GCC picks wrong template method instantiation if there are same name classes in independent compilation units

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

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |INVALID

--- Comment #1 from Andrew Pinski  ---
You are violating the one definition rule of c++ with different definition of
Point.

In c++ types have linkage and which is why anonymous namespaces were added so
you get internal linkage for the translation units.

Gold linker has an odr violation detector and if you turn on gcc's lto gcc will
also detect this violation.

I can't remember if the sanitorizers have an odr violation detector or not.

[Bug libfortran/81984] NULL string pointer dereferencing forces undefined behaviour in libgfortran

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

--- Comment #3 from Dominique d'Humieres  ---
> A core dump would be better.

Can you please elaborate?

[Bug fortran/82018] -Wextra should imply -Wconversion-extra

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

Dominique d'Humieres  changed:

   What|Removed |Added

   Priority|P3  |P5
   Severity|normal  |enhancement

--- Comment #8 from Dominique d'Humieres  ---
> Another alternative would be to have three flags:
> ...

Exactly what I feared in comment 4!-(the time taken by this PR is not devoted
to more important ones, e.g., final review for Paul's patch PR34640).

[Bug fortran/82018] -Wextra should imply -Wconversion-extra

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

--- Comment #7 from Thomas Koenig  ---
I expect strong negative feedback if -Wextra starts emitting
lots of warnings about code which is not problematic. This
would diminish the usefulness of -Wextra, and people will
simply remove it from their Makefiles.

Another alternative would be to have three flags:

-Wconversion like now
-Wconversion-extra which catches stuff like i=2.0 (without rounding errors),
 to be enabled by -Wextra
-Wconversion-all which also catches stuff which is always harmless, like
 i8=i4, c4=r4 etc.

[Bug debug/81993] [7 Regression] -gsplit-dwarf removes some symbols, causing some undefined references

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

--- Comment #13 from Sylvestre Ledru  ---
Thanks, I appreciate the very quick reaction!

[Bug target/81593] Optimize PowerPC vector set from vector extract

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

Michael Meissner  changed:

   What|Removed |Added

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

--- Comment #6 from Michael Meissner  ---
Fix applied in trunk, gcc-7, and gcc-6 branches.

[Bug target/81593] Optimize PowerPC vector set from vector extract

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

--- Comment #5 from Michael Meissner  ---
Author: meissner
Date: Wed Aug 30 13:38:27 2017
New Revision: 251532

URL: https://gcc.gnu.org/viewcvs?rev=251532=gcc=rev
Log:
[gcc]
2017-08-30  Michael Meissner  

Back port from trunk
2017-08-07  Michael Meissner  

PR target/81593
* config/rs6000/vsx.md (vsx_concat__1): New combiner insns
to recognize inserting into a vector from a double word element
that was extracted from another vector, and eliminate extra
XXPERMDI instructions.
(vsx_concat__2): Likewise.
(vsx_concat__3): Likewise.
(vsx_set_, VSX_D): Rewrite vector set in terms of vector
concat to allow optimizing inserts from previous extracts.

[gcc/testsuite]
2017-08-30  Michael Meissner  

Back port from trunk
2017-08-07  Michael Meissner  

PR target/81593
* gcc.target/powerpc/vec-setup.h: New tests to test various
combinations of setting up vectors of 2 double word elements.
* gcc.target/powerpc/vec-setup-long.c: Likewise.
* gcc.target/powerpc/vec-setup-double.c: Likewise.
* gcc.target/powerpc/vec-setup-be-long.c: Likewise.
* gcc.target/powerpc/vec-setup-be-double.c: Likewise.
* gcc.target/powerpc/vsx-extract-6.c: New tests for optimzing
vector inserts from vector extracts.
* gcc.target/powerpc/vsx-extract-7.c: Likewise.


Added:
   
branches/gcc-6-branch/gcc/testsuite/gcc.target/powerpc/vec-setup-be-double.c
  - copied unchanged from r251429,
trunk/gcc/testsuite/gcc.target/powerpc/vec-setup-be-double.c
branches/gcc-6-branch/gcc/testsuite/gcc.target/powerpc/vec-setup-be-long.c
  - copied unchanged from r251429,
trunk/gcc/testsuite/gcc.target/powerpc/vec-setup-be-long.c
branches/gcc-6-branch/gcc/testsuite/gcc.target/powerpc/vec-setup-double.c
  - copied unchanged from r251429,
trunk/gcc/testsuite/gcc.target/powerpc/vec-setup-double.c
branches/gcc-6-branch/gcc/testsuite/gcc.target/powerpc/vec-setup-long.c
  - copied unchanged from r251429,
trunk/gcc/testsuite/gcc.target/powerpc/vec-setup-long.c
branches/gcc-6-branch/gcc/testsuite/gcc.target/powerpc/vec-setup.h
  - copied unchanged from r251429,
trunk/gcc/testsuite/gcc.target/powerpc/vec-setup.h
branches/gcc-6-branch/gcc/testsuite/gcc.target/powerpc/vsx-extract-6.c
branches/gcc-6-branch/gcc/testsuite/gcc.target/powerpc/vsx-extract-7.c
Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/config/rs6000/vsx.md
branches/gcc-6-branch/gcc/testsuite/ChangeLog

[Bug c++/82035] New: GCC picks wrong template method instantiation if there are same name classes in independent compilation units

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

Bug ID: 82035
   Summary: GCC picks wrong template method instantiation if there
are same name classes in independent compilation units
   Product: gcc
   Version: 6.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: denis at denivip dot ru
  Target Milestone: ---

Created attachment 42086
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42086=edit
A minimal set for reproducing the bug

If we have two independent compilation units (lets say PointsPusher.cpp and
WrongPointsPusher.cpp) and both internally use std::vector push_back method
with their own definitions of a class (lets say Point which has different size
in these definitions) then during the compilation of the second unit push_back
method will be taken from the first unit, leading to incorrect memory
allocations and vector size management.

Here is an example: PointsPusher defines Point as 3 float values,
WrongPointsPusher defines Point as 3 double values. If GCC compiled
WrongPointsPusher then during PointsPusher compilation std::vector push_back
method will be using incorrect size Point.

I assume that gcc simply takes previously cached version of the instantiated
template method and uses it in another unit despite different template
parameter (different class size).

GCC should instantiate template methods with classes of current compilation
unit event if there are same name classes in other independent units.

This bug is especially annoying for big teams where several developers could
use same name classes in their compilation units, and that would lead to weird
behaviour.

Depending on optimization level (-0) there's different amount of memory
reallocations, hence slighlty different behaviour (but always erroneous).

I've prepared a minimal set of source files with a makefile, so you could
easily see the issue.

The bug was noticed in:
* gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 
* gcc version 6.3.0 20170519 (Ubuntu/Linaro 6.3.0-18ubuntu2~16.04) 

In gcc 7.1 it seems to be ok.

[Bug inline-asm/82001] [5/6/7 regression] wrong code when two functions differ only in inline asm register constraints

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

Martin Liška  changed:

   What|Removed |Added

  Known to work||8.0
Summary|[5/6/7/8 regression] wrong  |[5/6/7 regression] wrong
   |code when two functions |code when two functions
   |differ only in inline asm   |differ only in inline asm
   |register constraints|register constraints
  Known to fail||5.4.0, 6.4.0, 7.2.0

--- Comment #3 from Martin Liška  ---
Fixed on trunk.

[Bug libfortran/81984] NULL string pointer dereferencing forces undefined behaviour in libgfortran

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

--- Comment #2 from Thomas Koenig  ---
A core dump would be better.

[Bug tree-optimization/81588] [7/8 Regression] Wrong code at -O2

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

Christophe Lyon  changed:

   What|Removed |Added

 CC||clyon at gcc dot gnu.org

--- Comment #9 from Christophe Lyon  ---
I've noticed that the new testcase (gcc.dg/tree-ssa/pr81588.c) fails on the
gcc-7 branch (r251446) on arm-linux-gnueabihf --with-cpu=cortex-a5
--with-fpu=vfpv3-d16-fp16.

[Bug target/82034] SMMLAR pattern not detected on ARMv7-M

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

Richard Biener  changed:

   What|Removed |Added

   Keywords||missed-optimization
 Target||arm
 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2017-08-30
 Ever confirmed|0   |1
   Severity|normal  |enhancement

--- Comment #1 from Richard Biener  ---
Can you please quote the typedefs for q31_t and q63_t, specify the GCC version
you tested and provide a full testcase that can be compiled?

[Bug libstdc++/82033] C++11 library doesn't work on AIX if GCC is built with --disable-bootstrap

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

Sam Thursfield  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |INVALID

--- Comment #3 from Sam Thursfield  ---
This was me jumping to conclusions, sorry.

[Bug libstdc++/82033] C++11 library doesn't work on AIX if GCC is built with --disable-bootstrap

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

--- Comment #2 from Sam Thursfield  ---
Sorry, I really thought I'd tracked down the correct cause before reporting the
bug, but it seems something else I'm doing is breaking the  library.

[Bug libfortran/81984] NULL string pointer dereferencing forces undefined behaviour in libgfortran

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

Dominique d'Humieres  changed:

   What|Removed |Added

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

--- Comment #1 from Dominique d'Humieres  ---
Confirmed on gcc7 and trunk (8.0).

[Bug inline-asm/82001] [5/6/7/8 regression] wrong code when two functions differ only in inline asm register constraints

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

--- Comment #2 from Martin Liška  ---
Author: marxin
Date: Wed Aug 30 12:38:31 2017
New Revision: 251530

URL: https://gcc.gnu.org/viewcvs?rev=251530=gcc=rev
Log:
Fix IPA ICF with ASM statements (PR inline-asm/82001).

2017-08-30  Martin Liska  

PR inline-asm/82001
* ipa-icf-gimple.c (func_checker::compare_tree_list_operand):
Rename to ...
(func_checker::compare_asm_inputs_outputs): ... this function.
(func_checker::compare_gimple_asm): Use the function to compare
also ASM constrains.
* ipa-icf-gimple.h: Rename the function.
2017-08-30  Martin Liska  

PR inline-asm/82001
* gcc.dg/ipa/pr82001.c: New test.

Added:
trunk/gcc/testsuite/gcc.dg/ipa/pr82001.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/ipa-icf-gimple.c
trunk/gcc/ipa-icf-gimple.h
trunk/gcc/testsuite/ChangeLog

[Bug libfortran/81985] several sanitizer undefined runtime errors in sanitized libgfortran

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

Dominique d'Humieres  changed:

   What|Removed |Added

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

--- Comment #1 from Dominique d'Humieres  ---
Confirmed on gcc7 and trunk (8.0).

[Bug libfortran/81938] valgrind error message and heap-buffer-overflow on address sanitized libgfortran.so

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

Dominique d'Humieres  changed:

   What|Removed |Added

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

--- Comment #1 from Dominique d'Humieres  ---
An instrumented gfortran gives at run time

==59185==ERROR: AddressSanitizer: heap-buffer-overflow on address
0x62101150 at pc 0x00010b132896 bp 0x7fff554f6020 sp 0x7fff554f6018
READ of size 4 at 0x62101150 thread T0
#0 0x10b132895 in _gfortrani_free_format_data
(/opt/gcc/gcc8g/lib/libgfortran.4.dylib+0xa21895)
#1 0x10b132a46 in _gfortrani_free_format_hash_table
(/opt/gcc/gcc8g/lib/libgfortran.4.dylib+0xa21a46)
#2 0x10b1ae7a9 in close_unit_1
(/opt/gcc/gcc8g/lib/libgfortran.4.dylib+0xa9d7a9)
#3 0x10b1ae9bf in _gfortrani_close_unit
(/opt/gcc/gcc8g/lib/libgfortran.4.dylib+0xa9d9bf)
#4 0x10b123fc7 in _gfortran_st_close
(/opt/gcc/gcc8g/lib/libgfortran.4.dylib+0xa12fc7)
#5 0x10a709ba1 in MAIN__
(/Users/dominiq/Documents/Fortran/g95bench/win/f90/bug/a.out+0x10ba1)
#6 0x10a709bda in main
(/Users/dominiq/Documents/Fortran/g95bench/win/f90/bug/a.out+0x10bda)
#7 0x7fffbcb65234 in start (/usr/lib/system/libdyld.dylib+0x5234)

0x62101150 is located 0 bytes to the right of 4176-byte region
[0x62100100,0x62101150)
allocated by thread T0 here:
#0 0x10cffb1da in wrap_malloc (/opt/gcc/gcc8w/lib/libasan.4.dylib+0x661da)
#1 0x10a714427  (/opt/gcc/gcc8g/lib/libgfortran.4.dylib+0x3427)
#2 0x10b13407f in _gfortrani_parse_format
(/opt/gcc/gcc8g/lib/libgfortran.4.dylib+0xa2307f)
#3 0x10b19c279 in data_transfer_init
(/opt/gcc/gcc8g/lib/libgfortran.4.dylib+0xa8b279)
#4 0x10b1a17d0 in _gfortran_st_write
(/opt/gcc/gcc8g/lib/libgfortran.4.dylib+0xa907d0)
#5 0x10a7098e0 in MAIN__
(/Users/dominiq/Documents/Fortran/g95bench/win/f90/bug/a.out+0x108e0)
#6 0x10a709bda in main
(/Users/dominiq/Documents/Fortran/g95bench/win/f90/bug/a.out+0x10bda)
#7 0x7fffbcb65234 in start (/usr/lib/system/libdyld.dylib+0x5234)

SUMMARY: AddressSanitizer: heap-buffer-overflow
(/opt/gcc/gcc8g/lib/libgfortran.4.dylib+0xa21895) in
_gfortrani_free_format_data
Shadow bytes around the buggy address:
  0x1c4201d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1c4201e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1c4201f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1c420200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1c420210: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x1c420220: 00 00 00 00 00 00 00 00 00 00[fa]fa fa fa fa fa
  0x1c420230: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x1c420240: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x1c420250: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x1c420260: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x1c420270: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:   00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:   fa
  Freed heap region:   fd
  Stack left redzone:  f1
  Stack mid redzone:   f2
  Stack right redzone: f3
  Stack after return:  f5
  Stack use after scope:   f8
  Global redzone:  f9
  Global init order:   f6
  Poisoned by user:f7
  Container overflow:  fc
  Array cookie:ac
  Intra object redzone:bb
  ASan internal:   fe
  Left alloca redzone: ca
  Right alloca redzone:cb
==59185==ABORTING

Program received signal SIGABRT: Process abort signal.

Also present in gcc7.

[Bug fortran/82007] DTIO write format stored in a string leads to severe errors

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

Dominique d'Humieres  changed:

   What|Removed |Added

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

--- Comment #3 from Dominique d'Humieres  ---
Confirmed.

[Bug libfortran/81939] valgrind error message in build_float_string and heap-buffer-overflow on address sanitized libgfortran.so

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

Dominique d'Humieres  changed:

   What|Removed |Added

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

--- Comment #1 from Dominique d'Humieres  ---
With an instrumented gfortran (Configured with: ../work/configure
--prefix=/opt/gcc/gcc8g --enable-languages=c,c++,fortran --with-gmp=/opt/mp-new
--with-system-zlib --with-isl=/opt/mp-new --disable-bootstrap
--disable-multilib --disable-libstdcxx CFLAGS='-L/opt/gcc/gcc8w/lib -lasan
-lubsan -fsanitize=address,undefined,leak -Og -g -fno-omit-frame-pointer'
CXXFLAGS='-fsanitize=address,undefined,leak -Og -g -fno-omit-frame-pointer'
LDFLAGS='-L/opt/gcc/gcc8w/lib -lasan -lubsan -ldl -lpthread'
) I get at runtime

=
==11558==ERROR: AddressSanitizer: heap-buffer-overflow on address
0x612002f7 at pc 0x000104bf6a23 bp 0x7fff5b70eec0 sp 0x7fff5b70eeb8
WRITE of size 1 at 0x612002f7 thread T0
#0 0x104bf6a22 in build_float_string
(/opt/gcc/gcc7gp/lib/libgfortran.4.dylib+0x702a22)
#1 0x104bf7cd6 in get_float_string
(/opt/gcc/gcc7gp/lib/libgfortran.4.dylib+0x703cd6)
#2 0x104bfa687 in write_float_0
(/opt/gcc/gcc7gp/lib/libgfortran.4.dylib+0x706687)
#3 0x104bfc83e in _gfortrani_write_f
(/opt/gcc/gcc7gp/lib/libgfortran.4.dylib+0x70883e)
#4 0x104bd08b5 in formatted_transfer_scalar_write
(/opt/gcc/gcc7gp/lib/libgfortran.4.dylib+0x6dc8b5)
#5 0x104bd32fe in formatted_transfer
(/opt/gcc/gcc7gp/lib/libgfortran.4.dylib+0x6df2fe)
#6 0x104bbf67a in _gfortran_transfer_real
(/opt/gcc/gcc7gp/lib/libgfortran.4.dylib+0x6cb67a)
#7 0x104bbf69b in _gfortran_transfer_real_write
(/opt/gcc/gcc7gp/lib/libgfortran.4.dylib+0x6cb69b)
#8 0x1044edcdf in MAIN__
(/Users/dominiq/Documents/Fortran/g95bench/win/f90/bug/a.out+0x10cdf)
#9 0x1044ede7c in main
(/Users/dominiq/Documents/Fortran/g95bench/win/f90/bug/a.out+0x10e7c)
#10 0x7fffbcb65234 in start (/usr/lib/system/libdyld.dylib+0x5234)

0x612002f7 is located 0 bytes to the right of 311-byte region
[0x612001c0,0x612002f7)
allocated by thread T0 here:
#0 0x10606877d in wrap_malloc (/opt/gcc/gcc7a/lib/libasan.4.dylib+0x6377d)
#1 0x1044f7541 in _gfortrani_xmalloc
(/opt/gcc/gcc7gp/lib/libgfortran.4.dylib+0x3541)
#2 0x104bef354 in select_string
(/opt/gcc/gcc7gp/lib/libgfortran.4.dylib+0x6fb354)
#3 0x104bfa5fc in write_float_0
(/opt/gcc/gcc7gp/lib/libgfortran.4.dylib+0x7065fc)
#4 0x104bfc83e in _gfortrani_write_f
(/opt/gcc/gcc7gp/lib/libgfortran.4.dylib+0x70883e)
#5 0x104bd08b5 in formatted_transfer_scalar_write
(/opt/gcc/gcc7gp/lib/libgfortran.4.dylib+0x6dc8b5)
#6 0x104bd32fe in formatted_transfer
(/opt/gcc/gcc7gp/lib/libgfortran.4.dylib+0x6df2fe)
#7 0x104bbf67a in _gfortran_transfer_real
(/opt/gcc/gcc7gp/lib/libgfortran.4.dylib+0x6cb67a)
#8 0x104bbf69b in _gfortran_transfer_real_write
(/opt/gcc/gcc7gp/lib/libgfortran.4.dylib+0x6cb69b)
#9 0x1044edcdf in MAIN__
(/Users/dominiq/Documents/Fortran/g95bench/win/f90/bug/a.out+0x10cdf)
#10 0x1044ede7c in main
(/Users/dominiq/Documents/Fortran/g95bench/win/f90/bug/a.out+0x10e7c)
#11 0x7fffbcb65234 in start (/usr/lib/system/libdyld.dylib+0x5234)

SUMMARY: AddressSanitizer: heap-buffer-overflow
(/opt/gcc/gcc7gp/lib/libgfortran.4.dylib+0x702a22) in build_float_string
Shadow bytes around the buggy address:
  0x1c24: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
  0x1c240010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1c240020: 00 00 00 00 00 00 00 00 00 00 fa fa fa fa fa fa
  0x1c240030: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
  0x1c240040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x1c240050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00[07]fa
  0x1c240060: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
  0x1c240070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1c240080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fa
  0x1c240090: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x1c2400a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:   00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:   fa
  Freed heap region:   fd
  Stack left redzone:  f1
  Stack mid redzone:   f2
  Stack right redzone: f3
  Stack after return:  f5
  Stack use after scope:   f8
  Global redzone:  f9
  Global init order:   f6
  Poisoned by user:f7
  Container overflow:  fc
  Array cookie:ac
  Intra object redzone:bb
  ASan internal:   fe
  Left alloca redzone: ca
  Right alloca redzone:cb
==11558==ABORTING

Program 

[Bug target/82034] New: SMMLAR pattern not detected on ARMv7-M

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

Bug ID: 82034
   Summary: SMMLAR pattern not detected on ARMv7-M
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: oscar.molin at sigicom dot com
  Target Milestone: ---

CMSIS-DSP contains the following macro in arm_math.h:

#define multAcc_32x32_keep32_R(a, x, y) \
a = (q31_t) (q63_t) a) << 32) + ((q63_t) x * y) + 0x8000LL ) >> 32)

This signature should ideally be translated to SMMLAR instruction but it is
not.
I noticed a speedup when I replaced this macro with a call to the instrinsic
SMMLAR.

Can this macro be translated into SMMLAR, and if so can this be implemented?
This it a feature request I guess.

Sorry if this was filed in the wrong category.

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

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

--- Comment #6 from Richard Biener  ---
To recap the situation we have sth like

earlyDebug.o

section .debug_info:
sym1:
  CU1
...
  CU2 at coff1


lateDebug.o

section .debug_info:
...
 DW_TAG_imported_unit
   DW_AT_import $sym1 - .debug_info + coff1


I suppose we could somehow rely on .debug_info being relocated to 0.  Changing
the assembler that way works (but we're missing the provider of the early debug
so I can't double-check the final dwarf).

I suppose we'd need a new dw2_asm_output primitive for this (offset
within zero-relocated section, sym + offset) plus the associated target
macro.  Or put that knowledge (section is relocated to zero) into
darwin_asm_output_dwarf_offset somehow.  Like with

Index: config/darwin.c
===
--- config/darwin.c (revision 251449)
+++ config/darwin.c (working copy)
@@ -2859,7 +2859,8 @@ darwin_asm_output_dwarf_delta (FILE *fil
   const char *lab1, const char *lab2,
   HOST_WIDE_INT offset)
 {
-  int islocaldiff = (lab1[0] == '*' && lab1[1] == 'L'
+  int islocaldiff = (lab2
+&& lab1[0] == '*' && lab1[1] == 'L'
 && lab2[0] == '*' && lab2[1] == 'L');
   const char *directive = (size == 8 ? ".quad" : ".long");

@@ -2869,8 +2870,11 @@ darwin_asm_output_dwarf_delta (FILE *fil
 fprintf (file, "\t%s\t", directive);

   assemble_name_raw (file, lab1);
-  fprintf (file, "-");
-  assemble_name_raw (file, lab2);
+  if (lab2)
+{
+  fprintf (file, "-");
+  assemble_name_raw (file, lab2);
+}
   if (offset != 0)
 fprintf (file, "+" HOST_WIDE_INT_PRINT_DEC, offset);
   if (islocaldiff)
@@ -2905,7 +2909,9 @@ darwin_asm_output_dwarf_offset (FILE *fi
   extra = 4;
 }
   snprintf (sname, 64, "*Lsection%.*s%.*s", namelen, name, extra, lto_add);
-  darwin_asm_output_dwarf_delta (file, size, lab, sname, offset);
+  darwin_asm_output_dwarf_delta (file, size, lab,
+strncmp (name, "__debug_info", namelen)
+? sname : NULL, offset);
 }

 /* Called from the within the TARGET_ASM_FILE_START for each target.  */


that seems to work with and without -flto up to the extent that UNDEFs
(the early debug is not extracted and thus not linked) seem to be
resolved to zero by the link editor.

[Bug target/81797] gcc 7.1.0 fails to build on macOS 10.13 (High Sierra):

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

--- Comment #11 from Jack Howarth  ---
For what it's worth, I managed to partially suppress the missing headers
bootstrap failure for libstdc++-v3 with the change...

++-v3/include/Makefile.in
--- libstdc++-v3/include/Makefile.in.orig   2017-08-29 22:22:17.0
-0400
+++ libstdc++-v3/include/Makefile.in2017-08-29 20:06:57.0 -0400
@@ -1761,7 +1761,7 @@
 # host_headers_extra are taken out of the build tree staging area;
 # the rest are taken from the original source tree.

-@GLIBCXX_HOSTED_TRUE@install-data-local: install-headers
+@GLIBCXX_HOSTED_TRUE@install-data-local: install-freestanding-headers
 @GLIBCXX_HOSTED_FALSE@install-data-local: install-freestanding-headers

 # This is a subset of the full install-headers rule.  We only need ,

However this change just moves the missing header error from stage1 to stage2.

[Bug libstdc++/82033] C++11 library doesn't work on AIX if GCC is built with --disable-bootstrap

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

--- Comment #1 from Jonathan Wakely  ---
(In reply to Sam Thursfield from comment #0)
> This builds fine using `g++ -std=c++11 -pthread`. *Unless* you built the
> compiler with `--disable-bootstrap`. In that case, it fails:

Don't do that then?

What compiler is used for the stage-1 build?  If it's GCC, what does 'gcc -v'
show?

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

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

--- Comment #5 from Richard Biener  ---
If port maintainers cannot resolve this somehow the workaround for darwin is to
force -g0 at LTO link time.  Unfortunately darwin doesn't support -gstabs
(anymore).

[Bug driver/81829] [7 Regression] /usr/bin/gcc-{ar,nm,ranlib} segfault without arguments

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

--- Comment #6 from Martin Liška  ---
(In reply to Xi Ruoyao from comment #5)
> (In reply to Martin Liška from comment #4)
> > (In reply to Xi Ruoyao from comment #3)
> > > marxin's patch:
> > > 
> > > http://gcc.gnu.org/ml/gcc-patches/2017-08/msg01116.html
> > > 
> > > But this patch doesn't work while /my_bin/bin contains a symlink.
> > 
> > Can you please describe your set up is more detail?
> 
> cd $BLDDIR
> $SRCDIR/configure && make -j$CPUNUM
> cd gcc
> for i in ar nm ranlib; do ln -sv gcc-$i $i; done
> export PATH=$PWD:$PATH
> ar
> (fork infinite processes)
> 
> Since my BLDDIR is /home/xry111/build/gcc, and /home/xry111/build is linked
> to
> /mnt/mm1/xry111, remove_prefix failed to remove /home/xry111/build/gcc/gcc
> from
> the prefixes.  If change to
> 
> export PATH=$(realpath $PWD):$PATH
> 
> It would be ok.

Huh, so many beasts out there.
What can you see with following patch:

diff --git a/gcc/gcc-ar.c b/gcc/gcc-ar.c
index 1155ba83e35..452ca87d2ce 100644
--- a/gcc/gcc-ar.c
+++ b/gcc/gcc-ar.c
@@ -199,6 +199,8 @@ main (int ac, char **av)

   /* If the exe_name points to the wrapper, remove folder of the wrapper
 from prefix and try search again.  */
+  fprintf (stderr, "exe_name: %s, wrapper_file: %s\n", exe_name,
+  wrapper_file);
   if (strcmp (exe_name, wrapper_file) == 0)
{
  char *exe_folder = wrapper_file;

It's probably related to lrealpath that does not follow links. Btw. is your
link a mount?
I'm tending to remove the whole smartness of gcc-ar that removes the prefix.

Martin

[Bug libstdc++/82033] New: C++11 library doesn't work on AIX if GCC is built with --disable-bootstrap

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

Bug ID: 82033
   Summary: C++11  library doesn't work on AIX if GCC is
built with --disable-bootstrap
   Product: gcc
   Version: 7.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: sam.thursfield at codethink dot co.uk
  Target Milestone: ---
  Host: powerpc-ibm-aix7.1.0.0
Target: powerpc-ibm-aix7.1.0.0
 Build: powerpc-ibm-aix7.1.0.0

Here's a simple testcase:

```
#include 
#include 
#include 

using namespace std;

void task1(string msg)
{
cout << "task1 says: " << msg;
}

int main()
{
std::thread t1(task1, "Hello");
t1.join();
}
```

This builds fine using `g++ -std=c++11 -pthread`. *Unless* you built the
compiler with `--disable-bootstrap`. In that case, it fails:

```threadtest.cpp: In function 'int main()':
threadtest.cpp:16:10: error: 'thread' is not a member of 'std'
 std::thread t1(task1, "Hello");
  ^~
threadtest.cpp:16:10: note: suggested alternative: 'tera'
 std::thread t1(task1, "Hello");
  ^~
  tera
threadtest.cpp:19:5: error: 't1' was not declared in this scope
 t1.join();
 ^~
threadtest.cpp:19:5: note: suggested alternative: 'tm'
 t1.join();
 ^~
 tm
```

[Bug fortran/81841] [5/6/7/8 Regression] THREADPRIVATE (OpenMP) wrongly rejected in BLOCK DATA

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

--- Comment #12 from janus at gcc dot gnu.org ---
(In reply to dbroemmel from comment #11)
> I'm not sure this is the test you had in mind.

Pretty much.

In principle it would be nice to have a runtime check as well, but for a
rejects-valid problem a compile-time check should also be sufficient (assuming
the runtime part has worked earlier and was not broken).

If you add a short ChangeLog entry and submit all of that to
fort...@gcc.gnu.org (and gcc-patc...@gcc.gnu.org) for formal approval, you're
pretty close to your first GCC contribution I would say ;)

Note that in principle one needs a copyright assignment to contribute (see
https://gcc.gnu.org/contribute.html), but for small changes that can be
omitted, so you should be fine.

I assume you don't have an svn account for the GCC servers, but I'll be happy
to commit the patch for you (once approved).

Thanks for your efforts!

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

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

--- Comment #4 from Richard Biener  ---
That is, looking for documentation on Mach-O I find in mach-o/reloc.h

 * Another type of generic relocation, GENERIC_RELOC_SECTDIFF, is to support
 * the difference of two symbols defined in different sections.  That is the
 * expression "symbol1 - symbol2 + constant" is a relocatable expression when
 * both symbols are defined in some section.  For this type of relocation the
 * both relocations entries are scattered relocation entries.  The value of
 * symbol1 is stored in the first relocation entry's r_value field and the
 * value of symbol2 is stored in the pair's r_value field.

which I thought would apply here.  Looks like this doesn't work for UNDEFs
for some weird reason?

Note all of these relocations are resolvable by the link editor.

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

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

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |8.0

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

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

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |8.0

[Bug tree-optimization/82032] [8 Regression] ICE in try_switch_expansion, at tree-switch-conversion.c:2063

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

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |8.0

  1   2   >