[Bug rtl-optimization/78962] New: i386: Missed optimization: unaligned SSE movs with force_align_arg_pointer

2016-12-31 Thread daniel.santos at pobox dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78962

Bug ID: 78962
   Summary: i386: Missed optimization: unaligned SSE movs with
force_align_arg_pointer
   Product: gcc
   Version: 5.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: daniel.santos at pobox dot com
  Target Milestone: ---

void b (void);  /* Normal System V function.  */
__attribute__((ms_abi, force_align_arg_pointer)) void a (void)
{
b ();
}

When using __attribute__((force_align_arg_pointer)) on 64-bit code, the stack
pointer is re-aligned, but SSE movs in pro/epilogues to save/restore clobbers
caused by the Microsoft ABI function calling a System V function are emitted
unaligned.  I posted a patchset for this problem here
https://gcc.gnu.org/ml/gcc-patches/2016-12/msg01924.html.  Uros advised to
resubmit when the next stage 1 rolls around, so filing a bug for now.

[Bug tree-optimization/78961] New: [7 Regression] FAIL: gcc.dg/tree-ssa/scev-3.c scan-tree-dump-times optimized "" 1

2016-12-31 Thread danglin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78961

Bug ID: 78961
   Summary: [7 Regression] FAIL: gcc.dg/tree-ssa/scev-3.c
scan-tree-dump-times optimized "" 1
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: danglin at gcc dot gnu.org
  Target Milestone: ---
  Host: hppa64-hp-hpux11.11
Target: hppa64-hp-hpux11.11
 Build: hppa64-hp-hpux11.11

Created attachment 40433
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40433=edit
Tree dump

Executing on host: /test/gnu/gcc/objdir/gcc/xgcc -B/test/gnu/gcc/objdir/gcc/
/test/gnu/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa/scev-3.c  
-fno-diagnostics-show-caret -fdiagnostics-color=never   -O2
-fdump-tree-optimized -S   -o scev-3.s(timeout = 300)
spawn /test/gnu/gcc/objdir/gcc/xgcc -B/test/gnu/gcc/objdir/gcc/
/test/gnu/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa/scev-3.c
-fno-diagnostics-show-caret -fdiagnostics-color=never -O2 -fdump-tree-optimized
-S -o scev-3.s
PASS: gcc.dg/tree-ssa/scev-3.c (test for excess errors)
FAIL: gcc.dg/tree-ssa/scev-3.c scan-tree-dump-times optimized "" 1

Similar fail:
FAIL: gcc.dg/tree-ssa/scev-4.c scan-tree-dump-times optimized "" 1

The above also fails on hppa-unknown-linux-gnu.

[Bug middle-end/78960] New: FAIL: gcc.dg/tree-ssa/builtin-sprintf.c execution test

2016-12-31 Thread danglin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78960

Bug ID: 78960
   Summary: FAIL: gcc.dg/tree-ssa/builtin-sprintf.c execution test
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: danglin at gcc dot gnu.org
  Target Milestone: ---
  Host: hppa64-hp-hpux11.11
Target: hppa64-hp-hpux11.11
 Build: hppa64-hp-hpux11.11

Executing on host: /test/gnu/gcc/objdir/gcc/xgcc -B/test/gnu/gcc/objdir/gcc/
/test/gnu/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf.c  
-fno-diagnostics-show-caret -fdiagnostics-color=never   -ansi -pedantic-errors
-O2 -Wall -Wno-pedantic -fprintf-return-value  -lm-o ./builtin-sprintf.exe 
  (timeout = 300)
spawn /test/gnu/gcc/objdir/gcc/xgcc -B/test/gnu/gcc/objdir/gcc/
/test/gnu/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf.c
-fno-diagnostics-show-caret -fdiagnostics-color=never -ansi -pedantic-errors
-O2 -Wall -Wno-pedantic -fprintf-return-value -lm -o ./builtin-sprintf.exe
/test/gnu/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf.c: In function
'test_d_i':
/test/gnu/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf.c:304:20:
warning: '0' flag ignored with precision and '%i' gnu_printf format [-Wformat=]
/test/gnu/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf.c:125:44: note:
in definition of macro 'RNG'
output is:
/test/gnu/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf.c: In function
'test_d_i':
/test/gnu/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf.c:304:20:
warning: '0' flag ignored with precision and '%i' gnu_printf format [-Wformat=]
/test/gnu/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf.c:125:44: note:
in definition of macro 'RNG'

PASS: gcc.dg/tree-ssa/builtin-sprintf.c  (test for warnings, line 304)
PASS: gcc.dg/tree-ssa/builtin-sprintf.c (test for excess errors)
Setting LD_LIBRARY_PATH to
:/test/gnu/gcc/objdir/gcc:/test/gnu/gcc/objdir/hppa64-hp-hpux11.11/./libatomic/.libs::/test/gnu/gcc/objdir/gcc:/test/gnu/gcc/objdir/hppa64-hp-hpux11.11/./libatomic/.libs
spawn [open ...]
PASS: test_c:137: "%c" result 1: "?"
PASS: test_c:138: "%c" result 1: "?"
PASS: test_c:139: "%1c" result 1: "?"
PASS: test_c:140: "%1c" result 1: "?"
PASS: test_c:141: "%*c" result 1: "?"
PASS: test_c:142: "%*c" result 1: "?"
PASS: test_c:143: "%c%c" result 2: "12"
PASS: test_c:144: "%c%c" result 2: "12"
PASS: test_c:145: "%3c" result 3: "  ?"
PASS: test_c:146: "%3c" result 3: "  ?"
PASS: test_c:147: "%*c" result 3: "  ?"
PASS: test_c:148: "%*c" result 3: "  ?"
PASS: test_c:150: "%*c%*c" result 3: " ??"
PASS: test_c:151: "%*c%*c" result 3: "? ?"
PASS: test_c:152: "%c%c%c" result 3: "123"
PASS: test_c:153: "%*c%c%c" result 3: "123"
PASS: test_c:154: "%*c%*c%c" result 3: "123"
PASS: test_c:155: "%*c%*c%*c" result 3: "123"
PASS: test_c:157: "%*c%*c" result 3: " ??"
PASS: test_c:158: "%*c%*c" result 3: "? ?"
PASS: test_c:159: "%c%c%c" result 3: "123"
PASS: test_c:160: "%*c%c%c" result 3: "123"
PASS: test_c:161: "%*c%*c%c" result 3: "123"
PASS: test_c:162: "%*c%*c%*c" result 3: "123"
PASS: test_c:164: "%c%c %c" result 4: "12 3"
PASS: test_c:165: "%c %c %c" result 5: "1 2 3"
PASS: test_c:166: "%c %c %c" result 5: "? ? ?"
PASS: test_d_i:220: "%d" result 1: "0"
PASS: test_d_i:221: "%d%d" result 2: "01"
PASS: test_d_i:222: "%d%d" result 3: "910"
PASS: test_d_i:223: "%d%d" result 4: "1112"
PASS: test_d_i:224: "%d:%d" result 5: "12:34"
PASS: test_d_i:225: "%d" result 5: "12345"
PASS: test_d_i:226: "%d" result 6: "-12345"
PASS: test_d_i:227: "%d:%d:%d:%d" result 15: "123:124:125:126"
PASS: test_d_i:229: "%i" result 1: "0"
PASS: test_d_i:230: "%i" result 1: "0"
PASS: test_d_i:248: "%11d" result 11: " -559038737"
PASS: test_d_i:249: "%+11d" result 11: " -559038737"
PASS: test_d_i:250: "%-11d" result 11: "-559038737 "
PASS: test_d_i:251: "%011d" result 11: "-0559038737"
PASS: test_d_i:270: "%20ld" result 20: "  3735928559"
PASS: test_d_i:271: "%+20ld" result 20: " +3735928559"
PASS: test_d_i:272: "%-20ld" result 20: "3735928559  "
PASS: test_d_i:273: "%020ld" result 20: "003735928559"
FAIL: test_d_i:287: "%hhi" expected result for "-16657" doesn't match function
call return value: 6 not in [1, 4]
FAIL: test_d_i:288: "%hhu" expected result for "48879" doesn't match function
call return value: 5 not in [1, 3]
PASS: test_d_i:290: "%hhi" result 4: "-128"
PASS: test_d_i:291: "%hhi" result 4: "-128"
PASS: test_d_i:292: "%hhi" result 4: "-128"
PASS: test_d_i:294: "%1hhi" result 4: "-128"
PASS: test_d_i:295: "%2hhi" result 4: "-128"
PASS: test_d_i:296: "%3hhi" result 4: "-128"
PASS: test_d_i:297: "%4hhi" result 4: "-128"
PASS: test_d_i:298: "%5hhi" result 5: " -128"
PASS: test_d_i:299: "%6hhi" result 6: "  -128"
PASS: test_d_i:300: "%6hhi" result 6: "  -128"
PASS: test_d_i:302: "%.hhi" result 0: ""
PASS: 

[Bug middle-end/78959] New: FAIL: gcc.c-torture/execute/pr78622.c

2016-12-31 Thread danglin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78959

Bug ID: 78959
   Summary: FAIL: gcc.c-torture/execute/pr78622.c
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: danglin at gcc dot gnu.org
CC: msebor at gcc dot gnu.org
  Target Milestone: ---
  Host: hppa64-hp-hpux11.11
Target: hppa64-hp-hpux11.11
 Build: hppa64-hp-hpux11.11

spawn /test/gnu/gcc/objdir/gcc/xgcc -B/test/gnu/gcc/objdir/gcc/
/test/gnu/gcc/gcc/gcc/testsuite/gcc.c-torture/execute/pr78622.c
-fno-diagnostics-show-caret -fdi
agnostics-color=never -O0 -w -Wformat-length=2 -lm -o ./pr78622.exe
PASS: gcc.c-torture/execute/pr78622.c   -O0  (test for excess errors)
Setting LD_LIBRARY_PATH to :/test/gnu/gcc/objdir/gcc::/test/gnu/gcc/objdir/gcc
spawn [open ...]
"4105" => 4
FAIL: gcc.c-torture/execute/pr78622.c   -O0  execution test

Fails at all optimizations.

[Bug tree-optimization/77318] [7 regression] FAIL: gfortran.dg/graphite/pr68279.f90 -O (internal compiler error)

2016-12-31 Thread danglin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77318

John David Anglin  changed:

   What|Removed |Added

 CC||danglin at gcc dot gnu.org

--- Comment #8 from John David Anglin  ---
Also seen on hppa64-hp-hpux11.11.

[Bug fortran/78958] New: FAIL: gfortran.dg/alloc_comp_class_5.f03 - Segmentation fault

2016-12-31 Thread danglin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78958

Bug ID: 78958
   Summary: FAIL: gfortran.dg/alloc_comp_class_5.f03 -
Segmentation fault
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: danglin at gcc dot gnu.org
  Target Milestone: ---
  Host: hppa64-hp-hpux11.11
Target: hppa64-hp-hpux11.11
 Build: hppa64-hp-hpux11.11

spawn /test/gnu/gcc/objdir/gcc/testsuite/gfortran/../../gfortran
-B/test/gnu/gcc
/objdir/gcc/testsuite/gfortran/../../
-B/test/gnu/gcc/objdir/hppa64-hp-hpux11.11
/./libgfortran/
/test/gnu/gcc/gcc/gcc/testsuite/gfortran.dg/alloc_comp_class_5.f
03 -fno-diagnostics-show-caret -fdiagnostics-color=never -O0 -pedantic-errors
-B
/test/gnu/gcc/objdir/hppa64-hp-hpux11.11/./libgfortran/.libs
-L/test/gnu/gcc/obj
dir/hppa64-hp-hpux11.11/./libgfortran/.libs
-L/test/gnu/gcc/objdir/hppa64-hp-hpu
x11.11/./libgfortran/.libs
-L/test/gnu/gcc/objdir/hppa64-hp-hpux11.11/./libatomic/.libs
-B/test/gnu/gcc/objdir/hppa64-hp-hpux11.11/./libquadmath/.libs
-L/test/gnu/gcc/objdir/hppa64-hp-hpux11.11/./libquadmath/.libs
-L/test/gnu/gcc/objdir/hppa64-hp-hpux11.11/./libquadmath/.libs -lm -o
./alloc_comp_class_5.exePASS: gfortran.dg/alloc_comp_class_5.f03   -O0  (test
for excess errors)Setting LD_LIBRARY_PATH to
.:/test/gnu/gcc/objdir/hppa64-hp-hpux11.11/./libgfortran/.libs:/test/gnu/gcc/objdir/hppa64-hp-hpux11.11/./libgfortran/.libs:/test/gnu/gcc/objdir/hppa64-hp-hpux11.11/./libatomic/.libs:/test/gnu/gcc/objdir/hppa64-hp-hpux11.11/./libquadmath/.libs:/test/gnu/gcc/objdir/hppa64-hp-hpux11.11/./libquadmath/.libs:/test/gnu/gcc/objdir/gcc:.:/test/gnu/gcc/objdir/hppa64-hp-hpux11.11/./libgfortran/.libs:/test/gnu/gcc/objdir/hppa64-hp-hpux11.11/./libgfortran/.libs
:/test/gnu/gcc/objdir/hppa64-hp-hpux11.11/./libatomic/.libs:/test/gnu/gcc/objdir/hppa64-hp-hpux11.11/./libquadmath/.libs:/test/gnu/gcc/objdir/hppa64-hp-hpux11.11/./libquadmath/.libs:/test/gnu/gcc/objdir/gccspawn
[open ...]Program received signal SIGSEGV: Segmentation fault - invalid memory
reference.

(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program:
/test/gnu/gcc/objdir/gcc/testsuite/gfortran/alloc_comp_class_5.exe 

Program received signal SIGSEGV, Segmentation fault.
0x83fffdd7d264 in ?? () from /lib/pa20_64/libc.2
(gdb) bt
#0  0x83fffdd7d264 in ?? () from /lib/pa20_64/libc.2
#1  0x83fffdd7ff38 in free () from /lib/pa20_64/libc.2
#2  0x40006018 in array_list::add_item (
a=, 
e=)
at /test/gnu/gcc/gcc/gcc/testsuite/gfortran.dg/alloc_comp_class_5.f03:28

Breakpoint 2, 0x83fffdd7fc08 in free () from /lib/pa20_64/libc.2
(gdb) bt
#0  0x83fffdd7fc08 in free () from /lib/pa20_64/libc.2
#1  0x40006018 in array_list::add_item (
a=, 
e=)
at /test/gnu/gcc/gcc/gcc/testsuite/gfortran.dg/alloc_comp_class_5.f03:28
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) p/x $r26
$3 = 0x8001b280

It looks like this address wasn't allocated or previously freed.

[Bug driver/78957] New: ICE: SIGSEGV with -fno-sso-struct=web

2016-12-31 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78957

Bug ID: 78957
   Summary: ICE: SIGSEGV with -fno-sso-struct=web
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: driver
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---

Likely similar to PR78933

Compiler output:
$ valgrind x86_64-pc-linux-gnu-gcc /dev/null -o /dev/null -fno-sso-struct=web
==24593== Invalid read of size 8
==24593==at 0x51972C: pp_format(pretty_printer*, text_info*)
(pretty-print.c:317)
==24593==by 0x4DEF55: diagnostic_report_diagnostic(diagnostic_context*,
diagnostic_info*) (diagnostic.c:961)
==24593==by 0x4E1B78: diagnostic_impl (diagnostic.c:1084)
==24593==by 0x4E1B78: internal_error(char const*, ...) (diagnostic.c:1395)
==24593==by 0x4DD13B: fancy_abort(char const*, int, char const*)
(diagnostic.c:1461)
==24593==by 0x496AD7: decode_cmdline_option (opts-common.c:671)
==24593==by 0x496AD7: decode_cmdline_options_to_array(unsigned int, char
const**, unsigned int, cl_decoded_option**, unsigned int*) (opts-common.c:836)
==24593==by 0x4034FF: driver::main(int, char**) (gcc.c:7209)
==24593==by 0x4039BB: main (gcc-main.c:46)
==24593==  Address 0x8 is not stack'd, malloc'd or (recently) free'd

[Bug libstdc++/78956] New: std::thread doesn't fully meet LWG 2097 requirement

2016-12-31 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78956

Bug ID: 78956
   Summary: std::thread doesn't fully meet LWG 2097 requirement
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

#include 
static_assert( !std::is_constructible_v );

This assertion should pass according to LWG 2097. We only get it right for
lvalues and non-const rvalues.

We also need:

  thread(const thread&&) = delete;