[Bug middle-end/68999] [6 Regression]: FAIL: gfortran.fortran-torture/execute/save_1.f90 execution

2016-01-11 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68999

Uroš Bizjak  changed:

   What|Removed |Added

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

--- Comment #9 from Uroš Bizjak  ---
Fixed.

[Bug middle-end/68999] [6 Regression]: FAIL: gfortran.fortran-torture/execute/save_1.f90 execution

2016-01-11 Thread uros at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68999

--- Comment #8 from uros at gcc dot gnu.org ---
Author: uros
Date: Mon Jan 11 15:48:40 2016
New Revision: 232229

URL: https://gcc.gnu.org/viewcvs?rev=232229&root=gcc&view=rev
Log:
PR middle-end/68999
* alias.c (base_alias_check): Move check for addresses with
alignment ANDs before the call for compare_base_decls.
(memrefs_conflict_p): Return -1 for different decls
that went through alignment adjustments.


Modified:
trunk/gcc/ChangeLog
trunk/gcc/alias.c

[Bug middle-end/68999] [6 Regression]: FAIL: gfortran.fortran-torture/execute/save_1.f90 execution

2015-12-23 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68999

Uroš Bizjak  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |ubizjak at gmail dot com

--- Comment #7 from Uroš Bizjak  ---
Patch at [1].

[1] https://gcc.gnu.org/ml/gcc-patches/2015-12/msg02082.html

[Bug middle-end/68999] [6 Regression]: FAIL: gfortran.fortran-torture/execute/save_1.f90 execution

2015-12-22 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68999

Uroš Bizjak  changed:

   What|Removed |Added

 CC||law at gcc dot gnu.org

--- Comment #6 from Uroš Bizjak  ---
Let's put this PR on Jeff's radar due to proposed patch.

[Bug middle-end/68999] [6 Regression]: FAIL: gfortran.fortran-torture/execute/save_1.f90 execution

2015-12-22 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68999

--- Comment #5 from Uroš Bizjak  ---
Created attachment 37108
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=37108&action=edit
Proposed patch

There is a logic error in Honza's patch. The part in memrefs_conflict_p should
be changed to:

-  /* If decls are different or we know by offsets that there is no
overlap,
-we win.  */
-  if (!cmp || !offset_overlap_p (c, xsize, ysize))
+  /* If decls are different and we know by offsets that
+there is no overlap, we win.  */
+  if (!cmp && !offset_overlap_p (c, xsize, ysize))
return 0;
-  /* Decls may or may not be different and offsets overlap*/
+  /* Decls are different and offsets overlap*/

Even if decls are different, their offsets shouldn't overlap! Addresses with
AND alignment operands depend on increased xsize and ysize, so no wonder gcc
fails to bootstrap on alpha.

In addition to this, the check for SYMBOL_REFs in base_alias_check should be
moved after checks for AND addresses.

The patch also adds some simplification. If symtab_address::equal_address_to
returns -1 for "unknown" (as is otherwise customary throughout the sources), we
can simplify compare_base_decls a bit.

The patch was bootstrapped and regression tested on x86_64-linux-gnu {,-m32}.
Currently, the bootstrap on alpha-linux-gnu is running (this target is a
massive user of AND-aligned addresses, and bootstrap already went well beyond
the point of reported bootstrap failure).

[Bug middle-end/68999] [6 Regression]: FAIL: gfortran.fortran-torture/execute/save_1.f90 execution

2015-12-22 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68999

--- Comment #4 from Uroš Bizjak  ---
The patch also causes bootstrap failure on alpha-linux-gnu native bootstrap.
Reverting the patch allows bootstrap to finish.

[Bug middle-end/68999] [6 Regression]: FAIL: gfortran.fortran-torture/execute/save_1.f90 execution

2015-12-21 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68999

Uroš Bizjak  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2015-12-21
   Target Milestone|--- |6.0
 Ever confirmed|0   |1

--- Comment #3 from Uroš Bizjak  ---
This is gdb session:

(gdb) r
Starting program: /space/homedirs/uros/test/a.out 

Program aborted. Backtrace:
#0  0x204D927
#1  0x204FCDF
#2  0x2120937
#3  0x12AB7 in foo_ at save_1.f90:11 (discriminator 3)
#4  0x12C1F in baz_ at save_1.f90:24

Program received signal SIGABRT, Aborted.
0x02290008 in raise () from /lib/libc.so.6.1
(gdb) bt
#0  0x02290008 in raise () from /lib/libc.so.6.1
#1  0x02291ae4 in abort () from /lib/libc.so.6.1
#2  0x0204fcb0 in ?? () from
/usr/lib/gcc/alpha-unknown-linux-gnu/4.9.3/libgfortran.so.3
#3  0x02120938 in _gfortran_abort () from
/usr/lib/gcc/alpha-unknown-linux-gnu/4.9.3/libgfortran.so.3
#4  0x00012ab8 in foo (b=) at save_1.f90:11
#5  0x00012c20 in baz () at save_1.f90:24
#6  0x0001273c in MAIN__ () at save_1.f90:27
#7  main (argc=, argv=) at save_1.f90:29
#8  0x02278464 in __libc_start_main () from /lib/libc.so.6.1
#9  0x000127a8 in _start ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb) f 4
#4  0x00012ab8 in foo (b=) at save_1.f90:11
11if (i .ne. 26 .or. j .ne. 131) call abort
(gdb) p i
$1 = 0
(gdb) p j
$2 = 131

As can be seen, "i" gets clobbered.

The difference starts with foo in f90.250r.sched1, where we now have:

;;   ==
;;   -- basic block 3 from 10 to 121 -- before reload
;;   ==

;;0--> b  0: i  17 r82=`*$LC0'
;;1--> b  0: i  16 r81=`s.894'
;;2--> b  0: i  10 r77=`i.892'
;;3--> b  0: i  20 r88=[r82+0xf&0xfff8]
;;4--> b  0: i  19 r84=[r82+0x8&0xfff8]
;;5--> b  0: i  22 r90=r82&0x7
;;5--> b  0: i  18 r83=[r82&0xfff8]
;;6--> b  0: i  27 r87=r88<<0x40-r82&0x7<<0x3
;;6--> b  0: i  43 r106=[r81+0xf&0xfff8]
;;7--> b  0: i  24 r86=r84<<0x40-r82&0x7<<0x3
;;7--> b  0: i  31 r92=[r82+0x10&0xfff8]
;;8--> b  0: i  26 r84=zxt(r84,0x40,r82<<0x3)
;;8--> b  0: i  32 r93=[r82+0x13&0xfff8]
;;9--> b  0: i  28 r87={(r90==0)?0:r87}
;;9--> b  0: i  44 r105=[r81&0xfff8]
;;   10--> b  0: i  23 r83=zxt(r83,0x40,r82<<0x3)
;;   10--> b  0: i  40 r101=[r82+0x14&0xfff8]
;;   11--> b  0: i  25 r86={(r90==0)?0:r86}
;;   11--> b  0: i  13 r79=`j.893'
;;   12--> b  0: i  30 r84=r84|r87
;;   13--> b  0: i  29 r83=r83|r86
;;   14--> b  0: i  46 r104=unspec[r84,0x40,r81] 3
;;   15--> b  0: i  51 r106=unspec[r106,0x40,r81] 4
;;   16--> b  0: i  48 r103=unspec[r83,0x40,r81] 3
;;   17--> b  0: i  47 r84=r84< b  0: i  53 r106=r106|r104
;;   18--> b  0: i  55 [r81+0xf&0xfff8]=r106
;;   19--> b  0: i  33 r94=r82+0x10
;;   20--> b  0: i  50 r103=r103|r84
;;   20--> b  0: i  56 [r81+0x8&0xfff8]=r103
;;   21--> b  0: i  34 r95=zxt(r92,0x20,r94<<0x3)
;;   21--> b  0: i  58 r109=[r81+0x13&0xfff8]
;;   22--> b  0: i  35 r96=r93&0x7fff<<0x40-r94&0x7<<0x3
;;   22--> b  0: i  59 r108=[r81+0x10&0xfff8]
;;   23--> b  0: i  60 r112=r81+0x10
;;   24--> b  0: i  38 r99=r95|r96
;;   25--> b  0: i  61 r111=unspec[r99,0x20,r112] 3
;;   26--> b  0: i  63 r109=unspec[r109,0x20,r112] 4
;;   27--> b  0: i  62 r110=zxn(r99#0)< b  0: i  64 r108=!0x< b  0: i  65 r109=r109|r111
;;   29--> b  0: i  67 [r81+0x13&0xfff8]=r109
;;   30--> b  0: i  66 r108=r108|r110
;;   30--> b  0: i  68 [r81+0x10&0xfff8]=r108
;;   31--> b  0: i  41 r102=r82+0x14
;;   31--> b  0: i  69 r114=[r81+0x14&0xfff8]
;;   32--> b  0: i  42 r100#0=zxt(r101,0x8,r102<<0x3)
;;   33--> b  0: i  70 r113=r81+0x14
;;   34--> b  0: i  49 r83=r83< b  0: i  52 r105=!0x< b  0: i  71 r114=!0xff< b  0: i  72 r115=zxn(r100)< b  0: i  78 $18=0x3
;;   39--> b  0: i  79 $17=0x20
;;   40--> b  0: i  80 $16=r81+0x15
;;   41--> b  0: i  11 r78=0x1a
;;   41--> b  0: i  12 [r77]=r78
;;   42--> b  0: i  14 r80=0x83
;;   42--> b  0: i  15 [r79]=r80
;;   43--> b  0: i  54 r105=r105|r83
;;   43--> b  0: i  57 [r81&0xfff8]=r105
;;   44--> b  0: i  73 r115=r115|r114
;;   44--> b  0: i  74 [r81+0x14&0xfff8]=r115
;;   45--> b  0: i  81 {$0=call [`memset'];use $29;clobber 

[Bug middle-end/68999] [6 Regression]: FAIL: gfortran.fortran-torture/execute/save_1.f90 execution

2015-12-21 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68999

--- Comment #2 from Uroš Bizjak  ---
Executing on host:
/space/homedirs/uros/gcc-build-fast/gcc/testsuite/gfortran/../../gfortran
-B/space/homedirs/uros/gcc-build-fast/gcc/testsuite/gfortran/../../
-B/space/homedirs/uros/gcc
-build-fast/alphaev68-unknown-linux-gnu/./libgfortran/
/space/homedirs/uros/gcc-svn/trunk/gcc/testsuite/gfortran.fortran-torture/execute/save_1.f90
 -fno-diagnostics-show-caret -fdiagnost
ics-color=never  -w  -O3 -g  
-B/space/homedirs/uros/gcc-build-fast/alphaev68-unknown-linux-gnu/./libgfortran/.libs
-L/space/homedirs/uros/gcc-build-fast/alphaev68-unknown-linux-gnu/./lib
gfortran/.libs
-L/space/homedirs/uros/gcc-build-fast/alphaev68-unknown-linux-gnu/./libgfortran/.libs
-L/space/homedirs/uros/gcc-build-fast/alphaev68-unknown-linux-gnu/./libatomic/.libs
 -
lm-o /space/homedirs/uros/gcc-build-fast/gcc/testsuite/gfortran/save_1.x   
(timeout = 300)
spawn /space/homedirs/uros/gcc-build-fast/gcc/testsuite/gfortran/../../gfortran
-B/space/homedirs/uros/gcc-build-fast/gcc/testsuite/gfortran/../../
-B/space/homedirs/uros/gcc-build-fast/a
lphaev68-unknown-linux-gnu/./libgfortran/
/space/homedirs/uros/gcc-svn/trunk/gcc/testsuite/gfortran.fortran-torture/execute/save_1.f90
-fno-diagnostics-show-caret -fdiagnostics-color=neve
r -w -O3 -g
-B/space/homedirs/uros/gcc-build-fast/alphaev68-unknown-linux-gnu/./libgfortran/.libs
-L/space/homedirs/uros/gcc-build-fast/alphaev68-unknown-linux-gnu/./libgfortran/.libs
-L/
space/homedirs/uros/gcc-build-fast/alphaev68-unknown-linux-gnu/./libgfortran/.libs
-L/space/homedirs/uros/gcc-build-fast/alphaev68-unknown-linux-gnu/./libatomic/.libs
-lm -o /space/homedi
rs/uros/gcc-build-fast/gcc/testsuite/gfortran/save_1.x
PASS: gfortran.fortran-torture/execute/save_1.f90 compilation,  -O3 -g 
Setting LD_LIBRARY_PATH to
.:/space/homedirs/uros/gcc-build-fast/alphaev68-unknown-linux-gnu/./libgfortran/.libs:/space/homedirs/uros/gcc-build-fast/alphaev68-unknown-linux-gnu/./libgfort
ran/.libs:/space/homedirs/uros/gcc-build-fast/alphaev68-unknown-linux-gnu/./libatomic/.libs:/space/homedirs/uros/gcc-build-fast/gcc:.:/space/homedirs/uros/gcc-build-fast/alphaev68-unknown
-linux-gnu/./libgfortran/.libs:/space/homedirs/uros/gcc-build-fast/alphaev68-unknown-linux-gnu/./libgfortran/.libs:/space/homedirs/uros/gcc-build-fast/alphaev68-unknown-linux-gnu/./libato
mic/.libs:/space/homedirs/uros/gcc-build-fast/gcc
spawn [open ...]

Program aborted. Backtrace:
#0  0x12c73 in bar_
at
/space/homedirs/uros/gcc-svn/trunk/gcc/testsuite/gfortran.fortran-torture/execute/save_1.f90:17
#1  0x12c73 in baz_
at
/space/homedirs/uros/gcc-svn/trunk/gcc/testsuite/gfortran.fortran-torture/execute/save_1.f90:24
#2  0x1281b in MAIN__
at
/space/homedirs/uros/gcc-svn/trunk/gcc/testsuite/gfortran.fortran-torture/execute/save_1.f90:27
#3  0x1281b in main
at
/space/homedirs/uros/gcc-svn/trunk/gcc/testsuite/gfortran.fortran-torture/execute/save_1.f90:29
FAIL: gfortran.fortran-torture/execute/save_1.f90 execution,  -O3 -g

[Bug middle-end/68999] [6 Regression]: FAIL: gfortran.fortran-torture/execute/save_1.f90 execution

2015-12-21 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68999

Uroš Bizjak  changed:

   What|Removed |Added

 CC||hubicka at gcc dot gnu.org

--- Comment #1 from Uroš Bizjak  ---
Introduced in r231478:

PR ipa/61886
PR middle-end/25140
* tree-ssa-alias.c (ptr_deref_may_alias_decl_p): Use compare_base_decls
(nonoverlapping_component_refs_of_decl_p): Update sanity check.
(decl_refs_may_alias_p): Use compare_base_decls.
* alias.c: Include cgraph.h
(rtx_equal_for_memref_p): Use rtx_equal_for_memref_p.
(compare_base_decls): New function.
(base_alias_check): Likewise.
(memrefs_conflict_p): Likewise.
(nonoverlapping_memrefs_p): Likewise.
* alias.h (compare_base_decls): Declare.

* gcc.c-torture/execute/alias-2.c: New testcase.

I will prepare some more analysis later. Author of the above commit CC'd.