[Bug fortran/79072] ICE with class(*) pointer function result and character value

2017-08-12 Thread neil.n.carlson at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79072

--- Comment #8 from neil.n.carlson at gmail dot com ---
Ping.  Is there any interest in fixing this regression?

[Bug libgomp/81768] [8 Regression] error: control flow in the middle of basic block

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

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
Version|unknown |8.0
   Target Milestone|--- |8.0
Summary|error: control flow in the  |[8 Regression] error:
   |middle of basic block   |control flow in the middle
   ||of basic block

[Bug fortran/42568] [Cygwin] BLOCKDATA referenced in EXTERNAL not loading from library

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

--- Comment #33 from Eric Gallager  ---
(In reply to Jerry DeLisle from comment #32)
> (In reply to Eric Gallager from comment #30)
> > (In reply to Jerry DeLisle from comment #29)
> > > I happened to just get Cygwin installed and running on my Windows box.  
> > > Let
> > > me run some tests and see if I can understand this.
> > 
> > Did you ever do this?
> 
> Nope, general life interference.

So... what should we do with this bug then? I'm trying to move it out of the
WAITING queue. Change to SUSPENDED?

[Bug tree-optimization/81834] New: Simple loop with single variable is not optimized out

2017-08-12 Thread geoffrey at allott dot email
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81834

Bug ID: 81834
   Summary: Simple loop with single variable is not optimized out
   Product: gcc
   Version: 7.1.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: geoffrey at allott dot email
  Target Milestone: ---

The following code:

int main() {
for(int i=0; i += i < 1000, i < 1000;);
}

optimizes on x86_64 to the following code:

main:
.LFB0:
xorl%eax, %eax
.L2:
xorl%edx, %edx
cmpl$999, %eax
setle   %dl
addl%edx, %eax
cmpl$999, %eax
jle .L2
xorl%eax, %eax
ret

I would expect the loop to be removed completely.

[Bug target/81833] [7/8 Regression] PowerPC: VSX: Miscompiles ffmpeg's scalarproduct_int16_vsx at -O1

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

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||wrong-code
   Target Milestone|--- |7.2
Summary|[7 Regression] PowerPC: |[7/8 Regression] PowerPC:
   |VSX: Miscompiles ffmpeg's   |VSX: Miscompiles ffmpeg's
   |scalarproduct_int16_vsx at  |scalarproduct_int16_vsx at
   |-O1 |-O1

[Bug target/81736] Unnecessary save and restore frame pointer with -fno-omit-frame-pointer

2017-08-12 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81736

--- Comment #9 from H.J. Lu  ---
Add -mno-omit-leaf-frame-pointer should make these tests pass on Solaris.

[Bug target/81736] Unnecessary save and restore frame pointer with -fno-omit-frame-pointer

2017-08-12 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81736

--- Comment #8 from H.J. Lu  ---
i386/sol2.h has

#define SUBTARGET_OPTIMIZATION_OPTIONS  \
  { OPT_LEVELS_1_PLUS, OPT_momit_leaf_frame_pointer, NULL, 1 }

i386.c:

 /* Keep nonleaf frame pointers.  */
  if (opts->x_flag_omit_frame_pointer)
opts->x_target_flags &= ~MASK_OMIT_LEAF_FRAME_POINTER;
  else if (TARGET_OMIT_LEAF_FRAME_POINTER_P (opts->x_target_flags))
opts->x_flag_omit_frame_pointer = 1;

flag_omit_frame_pointer is always true and -fno-omit-frame-pointer
is ignored for Solaris.

[Bug middle-end/81832] ICE in expand_LOOP_DIST_ALIAS, at internal-fn.c:2273

2017-08-12 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81832

Martin Liška  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-08-12
 CC||jgreenhalgh at gcc dot gnu.org,
   ||marxin at gcc dot gnu.org
   Target Milestone|--- |8.0
 Ever confirmed|0   |1

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

[Bug testsuite/81793] gcc.dg/pie-static-[12].c FAIL

2017-08-12 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81793

--- Comment #7 from Segher Boessenkool  ---
Rainer: what I reported _is_ a target issue, and fixed by Alan's r251065.
powerpc-linux supports static and pie just fine.  Your patch is also good,
but a separate issue!

[Bug target/81736] Unnecessary save and restore frame pointer with -fno-omit-frame-pointer

2017-08-12 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81736

H.J. Lu  changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution|--- |FIXED

--- Comment #7 from H.J. Lu  ---
(In reply to Rainer Orth from comment #6)
> Two of the new tests FAIL on 32-bit Solaris/x86:
> 
> +FAIL: gcc.target/i386/pr81736-3.c scan-assembler %[re]bp
> +FAIL: gcc.target/i386/pr81736-4.c scan-assembler %[re]bp
> 
> The body of the first one (when configured with gas) is just
> 
> foo:
> pushl   %ebx
> /APP
> / 7 "/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.target/i386/pr81736-3.c" 1
> # 
> / 0 "" 2
> /NO_APP
> popl%ebx
> ret
> 
>   Rainer

I backed out my change and got

[hjl@gnu-tools-1 gcc]$ 
/export/build/gnu/gcc-cross/build-i386-solaris2.11/gcc/xgcc
-B/export/build/gnu/gcc-cross/build-i386-solaris2.11/gcc/
/export/gnu/import/git/sources/gcc/gcc/testsuite/gcc.target/i386/pr81736-3.c
-fno-diagnostics-show-caret -fdiagnostics-color=never -mclear-hwcap -O2
-fno-omit-frame-pointer -S -o pr81736-3.s
[hjl@gnu-tools-1 gcc]$ cat pr81736-3.s
.file   "pr81736-3.c"
.text
.align 16
.globl  foo
.type   foo, @function
foo:
pushl   %ebx
/APP
/ 7
"/export/gnu/import/git/sources/gcc/gcc/testsuite/gcc.target/i386/pr81736-3.c"
1
# 
/NO_APP
popl%ebx
ret
.size   foo, .-foo
.ident  "GCC: (GNU) 8.0.0 20170812 (experimental)"
[hjl@gnu-tools-1 gcc]$ 

These 2 testcases may have exposed an existing issue for Solaris/i386 target.
Please verify it with GCC 7 and open a new bug if this is a real issue.

[Bug fortran/42568] [Cygwin] BLOCKDATA referenced in EXTERNAL not loading from library

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

--- Comment #32 from Jerry DeLisle  ---
(In reply to Eric Gallager from comment #30)
> (In reply to Jerry DeLisle from comment #29)
> > I happened to just get Cygwin installed and running on my Windows box.  Let
> > me run some tests and see if I can understand this.
> 
> Did you ever do this?

Nope, general life interference.

[Bug testsuite/81793] gcc.dg/pie-static-[12].c FAIL

2017-08-12 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81793

Rainer Orth  changed:

   What|Removed |Added

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

--- Comment #6 from Rainer Orth  ---
Fixed.

[Bug testsuite/81793] gcc.dg/pie-static-[12].c FAIL

2017-08-12 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81793

--- Comment #5 from Rainer Orth  ---
Author: ro
Date: Sat Aug 12 16:00:00 2017
New Revision: 251067

URL: https://gcc.gnu.org/viewcvs?rev=251067=gcc=rev
Log:
Require -static support in gcc.dg/pie-static-[12].c (PR testsuite/81793)

PR testsuite/81793
* gcc.dg/pie-static-1.c: Require both static and pie support.
* gcc.dg/pie-static-2.c: Likewise.

Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/pie-static-1.c
trunk/gcc/testsuite/gcc.dg/pie-static-2.c

[Bug testsuite/81793] gcc.dg/pie-static-[12].c FAIL

2017-08-12 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81793

Rainer Orth  changed:

   What|Removed |Added

 Target|powerpc*-linux  |
 CC||ro at gcc dot gnu.org
  Component|target  |testsuite
   Assignee|unassigned at gcc dot gnu.org  |ro at gcc dot gnu.org
   Target Milestone|--- |8.0
Summary|static pie fails on |gcc.dg/pie-static-[12].c
   |powerpc-linux   |FAIL

--- Comment #4 from Rainer Orth  ---
Mine.

Not a target issue: the testcases also fail on Solaris 11.4 (which has PIE but
not static libc, libm), Linux/x86_64 without static libm, libc installed, and
Darwin/x86_64 (
FAIL: gcc.dg/pie-static-1.c (test for excess errors)
Excess errors:
ld: library not found for -lcrt0.o
).

Patch in progress; need to investigate Darwin problem first (or split off).

  Rainer

[Bug target/81736] Unnecessary save and restore frame pointer with -fno-omit-frame-pointer

2017-08-12 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81736

Rainer Orth  changed:

   What|Removed |Added

 CC||ro at gcc dot gnu.org

--- Comment #6 from Rainer Orth  ---
Two of the new tests FAIL on 32-bit Solaris/x86:

+FAIL: gcc.target/i386/pr81736-3.c scan-assembler %[re]bp
+FAIL: gcc.target/i386/pr81736-4.c scan-assembler %[re]bp

The body of the first one (when configured with gas) is just

foo:
pushl   %ebx
/APP
/ 7 "/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.target/i386/pr81736-3.c" 1
# 
/ 0 "" 2
/NO_APP
popl%ebx
ret

  Rainer

[Bug target/81833] New: [7 Regression] PowerPC: VSX: Miscompiles ffmpeg's scalarproduct_int16_vsx at -O1

2017-08-12 Thread james410 at cowgill dot org.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81833

Bug ID: 81833
   Summary: [7 Regression] PowerPC: VSX: Miscompiles ffmpeg's
scalarproduct_int16_vsx at -O1
   Product: gcc
   Version: 7.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: james410 at cowgill dot org.uk
  Target Milestone: ---

Created attachment 41984
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41984=edit
vsx-ffmpeg-test.c

Originally from this Debian bug:
https://bugs.debian.org/871565

GCC 7 miscompiles the scalarproduct_int16_vsx function found in FFmpeg's
source. With the attached testcase, the result is always 0 but it should return
8.

Compile with:
> gcc -c -O1 vsx-ffmpeg-test.c

This is the miscompiled assembly:
>  :
>0:   0c 03 80 11 vspltisb v12,0 
>4:   8c 03 20 10 vspltisw v1,0  
>8:   00 00 85 2f cmpwi   cr7,r5,0
>c:   3c 00 9d 40 ble cr7,48 
>   10:   00 00 40 39 li  r10,0   
>   14:   99 1e 00 7c lxvd2x  vs32,0,r3
>   18:   57 02 00 f0 xxswapd vs32,vs32
>   1c:   ce 20 a0 7d lvx v13,0,r4
>   20:   28 6b 00 10 vmsumshm v0,v0,v13,v12
>   24:   8c 0a 00 10 vspltw  v0,v1,0
>   28:   88 07 00 10 vsumsws v0,v0,v0
>   2c:   2c 03 20 10 vsldoi  v1,v0,v0,12   
>   30:   10 00 63 38 addir3,r3,16   
>   34:   10 00 84 38 addir4,r4,16
>   38:   08 00 2a 39 addir9,r10,8
>   3c:   b4 07 2a 7d extsw   r10,r9
>   40:   00 48 85 7f cmpwcr7,r5,r9
>   44:   d0 ff 9d 41 bgt cr7,14 
>   48:   93 0a 20 f0 xxspltw vs33,vs33,0   
>   4c:   f0 ff 21 39 addir9,r1,-16 
>   50:   8e 49 20 7c stvewx  v1,0,r9
>   54:   f2 ff 61 e8 lwa r3,-16(r1)
>   58:   20 00 80 4e blr

The instructions at 24 and 28 look dodgy to me. It looks to me like the t and
res variables have been assigned the same register and they get clobbered while
they're still live.

In this case the __attribute__((noinline)) is required - removing it allows the
code to work correctly.

[Bug testsuite/81738] [8 Regression] gcc.dg/vect/vect-alias-check-6.c FAILs

2017-08-12 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81738

Rainer Orth  changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from Rainer Orth  ---
Fixed indeed.

Thanks.
  Rainer

[Bug tree-optimization/81809] missing -Wuninitialized due to alias analysis limitation

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

Eric Gallager  changed:

   What|Removed |Added

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

--- Comment #2 from Eric Gallager  ---
Confirmed.

[Bug fortran/60355] [F08] constraint C519 for BIND attribute not enforced

2017-08-12 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60355

Thomas Koenig  changed:

   What|Removed |Added

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

--- Comment #5 from Thomas Koenig  ---
Fixed on trunk, closing.

[Bug fortran/39627] [meta-bug] Fortran 2008 support

2017-08-12 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39627
Bug 39627 depends on bug 60355, which changed state.

Bug 60355 Summary: [F08] constraint C519 for BIND attribute not enforced
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60355

   What|Removed |Added

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

[Bug ada/79542] [7/8 regression] ICE in add_gnat_descriptive_type_attribute

2017-08-12 Thread gnugcc at marino dot st
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79542

--- Comment #9 from John Marino  ---
That's great, although it seems to only have been applied to TRUNK (gcc 8).  I
know it is too late for gcc 7.2, but this changeset should still be backported
to the GCC 7.x branch as well.

[Bug middle-end/81832] New: ICE in expand_LOOP_DIST_ALIAS, at internal-fn.c:2273

2017-08-12 Thread antoine.balestrat at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81832

Bug ID: 81832
   Summary: ICE in expand_LOOP_DIST_ALIAS, at internal-fn.c:2273
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: antoine.balestrat at gmail dot com
  Target Milestone: ---

Hello !
I'm using a freshly built version of GCC (gcc version 8.0.0 20170812) :

$ cat tested.c
int a, b, *c;
void d(void)
{
int **e;
for(;;)
for(int f = 1; f <= 6; f++)
{
b = 0;
if(a)
g:
while(a++);
if (**e);
else
{
*c = a;
goto g;
}
}
}

$ xgcc -O3 -c tested.c
during RTL pass: expand
tested.c: In function ‘d’:
tested.c:2:6: internal compiler error: in expand_LOOP_DIST_ALIAS, at
internal-fn.c:2273
 void d(void)
  ^
0x958807 expand_LOOP_DIST_ALIAS
../../srcdir/gcc/internal-fn.c:2273
0x724bf7 expand_call_stmt
../../srcdir/gcc/cfgexpand.c:2577
0x724bf7 expand_gimple_stmt_1
../../srcdir/gcc/cfgexpand.c:3585
0x724bf7 expand_gimple_stmt
../../srcdir/gcc/cfgexpand.c:3751
0x726957 expand_gimple_basic_block
../../srcdir/gcc/cfgexpand.c:5753
0x72cb7e execute
../../srcdir/gcc/cfgexpand.c:6360
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

[Bug c/81785] Segmentation fault for signed overflow in index expression when -fwrapv is enabled

2017-08-12 Thread mikpelinux at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81785

Mikael Pettersson  changed:

   What|Removed |Added

 CC||mikpelinux at gmail dot com

--- Comment #2 from Mikael Pettersson  ---
Created attachment 41983
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41983=edit
simple test case

Simpler test case that will __builtin_abort () when the bug hits rather than
segfault.  Problem seems to be that

int * __attribute__((__noinline__, __noclone__))
foo(int x[])
{
int k = INT_MIN;
return [k - INT_MAX];
}

becomes the bogus code

foo:
movabsq $-17179869180, %rax
addq%rdi, %rax
ret

which returns a pointer to a large negative offset off x[], even though -fwrapv
has been passed to gcc.

The equivalent

int * __attribute__((__noinline__, __noclone__))
bar(int x[])
{
return [INT_MIN - INT_MAX];
}

becomes the expected code

bar:
leaq4(%rdi), %rax
ret

although gcc also emits an IMO unwarranted (since -fwrapv is present) warning

pr81785.c: In function 'bar':
pr81785.c:20:23: warning: integer overflow in expression of type 'int' results
in '1' [-Woverflow]
 return [INT_MIN - INT_MAX];

Affects every single gcc since 3.x on x86_64 as far as I can tell.

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

2017-08-12 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81829

Martin Liška  changed:

   What|Removed |Added

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

--- Comment #1 from Martin Liška  ---
Let me fix that.

[Bug ada/79542] [7/8 regression] ICE in add_gnat_descriptive_type_attribute

2017-08-12 Thread pmderodat at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79542

--- Comment #8 from pmderodat at gcc dot gnu.org ---
Author: pmderodat
Date: Sat Aug 12 09:07:12 2017
New Revision: 251066

URL: https://gcc.gnu.org/viewcvs?rev=251066=gcc=rev
Log:
[PR79542][Ada] Fix ICE in dwarf2out.c with nested func. inlining

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79542 reports an ICE in
dwarf2out.c for an Ada testcase built with optimization.

This crash happens during the late generation pass because
add_gnat_descriptive_type cannot find the type DIE corresponding to some
descriptive type after having tried to generate it. This is because the
DIE was generated during the early generation pass, but then pruned by
the type pruning machinery. So why was it pruned?

We are in a situation where we have cloned types (because of inlining,
IIUC) whose TYPE_NAME have non-null DECL_ABSTRACT_ORIGIN attributes. As
a consequence:

  * In modified_type_die, the "handle C typedef types" part calls
gen_type_die on the cloned type.

  * gen_type_die matches a typedef variant, and then calls gen_decl_die
on its TYPE_NAME, which will end up calling gen_typedef_die.

  * gen_typedef_die checks decl_ultimate_origin for this TYPE_DECL, and
finds one, so it only adds a DW_AT_abstract_origin attribute to the
DW_TAG_typedef DIE, but the cloned type itself does not get its own
DIE.

  * Back in modified_type_die, the call to lookup_type_die on the type
passed to gen_type_die returns NULL.

In the end, whole type trees, i.e. the ones referenced by
DECL_ABSTRACT_ORIGIN attributes, are never referenced from type pruning
"roots" and are thus pruned. The descriptive type at stake here is one
of them, hence the assertion failure.

This patch attemps to fix that with what seems to be the most sensible
thing to do in my opinion: updating the "handle C typedef types" part in
modified_type_die to check decl_ultimate_origin before calling
gen_type_die: if that function returns something not null, then we know
that gen_type_die/gen_typedef_die will not generate a DIE for the input
type, so we try to process the ultimate origin instead. It also updates
in a similar way gen_type_die_with_usage, assert that when
gen_typedef_die is called on nodes that have an ultimate origin, this
origin is themselves.

gcc/
PR ada/79542
* dwarf2out.c (modified_type_die): For C typedef types that have
an ultimate origin, process the ultimate origin instead of the
input type.
(gen_typedef_die): Assert that input DECLs have no ultimate
origin.
(gen_type_die_with_usage): For typedef variants that have an
ultimate origin, just call gen_decl_die on the original DECL.
(process_scope_var): Avoid creating DIEs for local typedefs and
concrete static variables.

gcc/testsuite/

PR ada/79542
* gnat.dg/debug13.ads, gnat.dg/debug13.adb: New testcase.

Added:
trunk/gcc/testsuite/gnat.dg/debug13.adb
trunk/gcc/testsuite/gnat.dg/debug13.ads
Modified:
trunk/gcc/ChangeLog
trunk/gcc/dwarf2out.c
trunk/gcc/testsuite/ChangeLog

[Bug libgcc/78804] [RX] -m64bit-doubles does not work

2017-08-12 Thread claziss at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78804

--- Comment #12 from Claudiu Zissulescu  ---
(In reply to Oleg Endo from comment #11)
> I'm confused.  Who is actually the effective maintainer of ARC?  All the
> patches on gcc-patches seem to go like 

Hi,

I am the effective ARC maintainer, just now I've seen your issue. Please allow
me some moments to analyze it.

Thanks,
Claudiu