[Bug debug/39086] New: Failing assert in dwarf2out.c:5770 when compiling with -fno-tree-sra

2009-02-03 Thread jamborm at gcc dot gnu dot org
When compiling test 27_io/basic_istream/requirements/explicit_instantiation.cc
from the libstc++ testsuite and adding the -fno-tree-sra flag, I get
the following error:

--
u...@host:~/gcc/svn/obj/i686-pc-linux-gnu/libstdc++-v3/testsuite$
$HOME/gcc/svn/obj/./gcc/g++ -shared-libgcc -B$HOME/gcc/svn/obj/./gcc
-nostdinc++ -L$HOME/gcc/svn/obj/i686-pc-linux-gnu/libstdc++-v3/src
-L$HOME/gcc/svn/obj/i686-pc-linux-gnu/libstdc++-v3/src/.libs
-B$HOME/gcc/inst/svn//i686-pc-linux-gnu/bin/
-B$HOME/gcc/inst/svn//i686-pc-linux-gnu/lib/ -isystem
$HOME/gcc/inst/svn//i686-pc-linux-gnu/include -isystem
$HOME/gcc/inst/svn//i686-pc-linux-gnu/sys-include -g -O2 -D_GLIBCXX_ASSERT
-fmessage-length=0 -ffunction-sections -fdata-sections -g -O2 -D_GNU_SOURCE -g
-O2   -D_GNU_SOURCE   -DLOCALEDIR=. -nostdinc++
-I$HOME/gcc/svn/obj/i686-pc-linux-gnu/libstdc++-v3/include/i686-pc-linux-gnu
-I$HOME/gcc/svn/obj/i686-pc-linux-gnu/libstdc++-v3/include
-I$HOME/gcc/svn/libstdc++-v3/libsupc++
-I$HOME/gcc/svn/libstdc++-v3/include/backward
-I$HOME/gcc/svn/libstdc++-v3/testsuite/util
$HOME/gcc/svn/libstdc++-v3/testsuite/27_io/basic_istream/requirements/explicit_instantiation.cc
   -include bits/stdc++.h -S  -o explicit_instantiation.s -fno-tree-sra
In file included from
$HOME/gcc/svn/obj/i686-pc-linux-gnu/libstdc++-v3/include/istream:833,
 from
$HOME/gcc/svn/obj/i686-pc-linux-gnu/libstdc++-v3/include/sstream:44,
 from
$HOME/gcc/svn/obj/i686-pc-linux-gnu/libstdc++-v3/include/complex:52,
 from
$HOME/gcc/svn/libstdc++-v3/include/precompiled/stdc++.h:69:
$HOME/gcc/svn/obj/i686-pc-linux-gnu/libstdc++-v3/include/bits/istream.tcc: In
member function 'typename std::basic_istream_CharT, _Traits::int_type
std::basic_istream_CharT, _Traits::get() [with _CharT =
__gnu_cxx::characterunsigned char, __gnu_test::pod_int,
__gnu_test::pod_state, _Traits =
std::char_traits__gnu_cxx::characterunsigned char, __gnu_test::pod_int,
__gnu_test::pod_state ]':
$HOME/gcc/svn/obj/i686-pc-linux-gnu/libstdc++-v3/include/bits/istream.tcc:222:
internal compiler error: in decl_ultimate_origin, at dwarf2out.c:5770
Please submit a full bug report,
with preprocessed source if appropriate.
See http://gcc.gnu.org/bugs.html for instructions.
--

This is with trunk revision 143890, compiled on i686-pc-linux without
bootstrap.  I will attach preprocessed source shortly.


-- 
   Summary: Failing assert in dwarf2out.c:5770 when compiling with -
fno-tree-sra
   Product: gcc
   Version: 4.4.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: debug
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jamborm at gcc dot gnu dot org
  GCC host triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39086



[Bug debug/39086] Failing assert in dwarf2out.c:5770 when compiling with -fno-tree-sra

2009-02-03 Thread jamborm at gcc dot gnu dot org


--- Comment #1 from jamborm at gcc dot gnu dot org  2009-02-03 15:09 ---
Created an attachment (id=17232)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17232action=view)
Preprocessed source

Enough to compile with -O2 -g -fno-tree-sra explicit_instantiation.ii


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39086



[Bug debug/39086] Failing assert in dwarf2out.c:5770 when compiling with -fno-tree-sra

2009-02-03 Thread jamborm at gcc dot gnu dot org


--- Comment #3 from jamborm at gcc dot gnu dot org  2009-02-03 16:56 ---
Created an attachment (id=17236)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17236action=view)
Preprocessed source

OK, this one is hopefully without any precompiled headers. 


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

  Attachment #17232|0   |1
is obsolete||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39086



[Bug middle-end/32964] [4.3/4.4 Regression] union cause inefficient code inside loops

2009-02-06 Thread jamborm at gcc dot gnu dot org


--- Comment #13 from jamborm at gcc dot gnu dot org  2009-02-06 21:45 
---
Indeed, this testcase is fully scalarized by the new SRA even as it is
today.  (If you don't know what new SRA I mean, I hope I'll post it to
the list as an RFC next week).


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||jamborm at gcc dot gnu dot
   ||org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32964



[Bug tree-optimization/39259] [4.4 Regression] internal compiler error: in initialize_cfun, at tree-inline.c:1749

2009-02-23 Thread jamborm at gcc dot gnu dot org


--- Comment #5 from jamborm at gcc dot gnu dot org  2009-02-23 14:09 ---
I don't understand the comment above the assert at all (Honza probably
does) and so this might not  be the correct approach but the following
patch should just obviously work.   At least it does for this testcase
and I am about to bootstrap and regression test it:

2009-02-23  Martin Jambor  mjam...@suse.cz

* tree-inline.c (tree_versionable_function_p): Return false for
functions calling setjmp or alloca.

Index: tree-inline.c
===
--- tree-inline.c   (revision 144380)
+++ tree-inline.c   (working copy)
@@ -4174,12 +4174,17 @@ copy_static_chain (tree static_chain, co
 bool
 tree_versionable_function_p (tree fndecl)
 {
+  struct function *fn_cfun;
   if (fndecl == NULL_TREE)
 return false;
   /* ??? There are cases where a function is
  uninlinable but can be versioned.  */
   if (!tree_inlinable_function_p (fndecl))
 return false;
+
+  fn_cfun = DECL_STRUCT_FUNCTION (fndecl);
+  if (fn_cfun-calls_setjmp || fn_cfun-calls_alloca)
+return false;

   return true;
 }


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39259



[Bug tree-optimization/39259] [4.4 Regression] internal compiler error: in initialize_cfun, at tree-inline.c:1749

2009-02-24 Thread jamborm at gcc dot gnu dot org


--- Comment #7 from jamborm at gcc dot gnu dot org  2009-02-24 13:44 ---
After discussion with Honza, I have tried a more complex approach, the
patch is at:

http://gcc.gnu.org/ml/gcc-patches/2009-02/msg01118.html


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |jamborm at gcc dot gnu dot
   |dot org |org
 Status|NEW |ASSIGNED
   Last reconfirmed|2009-02-21 17:56:56 |2009-02-24 13:44:34
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39259



[Bug tree-optimization/39259] [4.4 Regression] internal compiler error: in initialize_cfun, at tree-inline.c:1749

2009-02-25 Thread jamborm at gcc dot gnu dot org


--- Comment #8 from jamborm at gcc dot gnu dot org  2009-02-25 18:19 ---
Fixed with:

Author: jamborm
Date: Wed Feb 25 17:34:40 2009
New Revision: 144428

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=144428
Log:
2009-02-25  Martin Jambor  mjam...@suse.cz

* tree-inline.c (initialize_cfun): Remove asserts for calls_setjmp and
alls_alloca function flags.
(copy_bb): Set calls_setjmp and alls_alloca function flags if such
calls are detected.


Added:
trunk/gcc/testsuite/g++.dg/torture/pr39259.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-inline.c


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39259



[Bug middle-end/37861] [4.3 Regression] Bogus array bounds warning

2009-02-27 Thread jamborm at gcc dot gnu dot org


--- Comment #12 from jamborm at gcc dot gnu dot org  2009-02-28 00:30 
---
I have just posted a patch to fix this issue on the 4.3 branch to the
mailing list:

http://gcc.gnu.org/ml/gcc-patches/2009-02/msg01245.html


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37861



[Bug middle-end/37861] [4.3 Regression] Bogus array bounds warning

2009-02-28 Thread jamborm at gcc dot gnu dot org


--- Comment #13 from jamborm at gcc dot gnu dot org  2009-02-28 18:33 
---
Subject: Bug 37861

Author: jamborm
Date: Sat Feb 28 18:33:27 2009
New Revision: 144491

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=144491
Log:
2009-02-28  Martin Jambor  mjam...@suse.cz

Backport from mainline:
2008-12-02  Martin Jambor  mjam...@suse.cz

PR middle-end/37861
* tree-ssa-forwprop.c 
(forward_propagate_addr_into_variable_array_index): Check that the
offset is not computed from a MULT_EXPR if element size is one.



Modified:
branches/gcc-4_3-branch/gcc/ChangeLog
branches/gcc-4_3-branch/gcc/tree-ssa-forwprop.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37861



[Bug middle-end/37861] [4.3 Regression] Bogus array bounds warning

2009-02-28 Thread jamborm at gcc dot gnu dot org


--- Comment #14 from jamborm at gcc dot gnu dot org  2009-02-28 22:46 
---
Fixed with revision 144491:

te: Sat Feb 28 18:33:27 2009
New Revision: 144491

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=144491
Log:
2009-02-28  Martin Jambor  mjam...@suse.cz

Backport from mainline:
2008-12-02  Martin Jambor  mjam...@suse.cz

PR middle-end/37861
* tree-ssa-forwprop.c 
(forward_propagate_addr_into_variable_array_index): Check that the
offset is not computed from a MULT_EXPR if element size is one.



Modified:
branches/gcc-4_3-branch/gcc/ChangeLog
branches/gcc-4_3-branch/gcc/tree-ssa-forwprop.c


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37861



[Bug tree-optimization/40081] verify_stmts failed with -O2

2009-05-10 Thread jamborm at gcc dot gnu dot org


--- Comment #7 from jamborm at gcc dot gnu dot org  2009-05-10 10:29 ---
New SRA handles this fine by not scalarizing anything that has volatile fields
in it. There is already a fortran testcase with a union with a volatile field
that made me aware of this.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40081



[Bug middle-end/40122] missed optimization when using union of __m128i and int[4]

2009-05-21 Thread jamborm at gcc dot gnu dot org


--- Comment #3 from jamborm at gcc dot gnu dot org  2009-05-21 16:02 ---
With he new SRA, the optimized dump looks like:

  D.6886_10 = {1, 1, 1, 1};
  D.6887_11 = VIEW_CONVERT_EXPRvector long long int(D.6886_10);
  D.6893_12 = VIEW_CONVERT_EXPRvector int(D.6887_11);
  D.6891_14 = __builtin_ia32_pcmpeqd128 (D.6893_12, D.6893_12);
  D.6890_15 = VIEW_CONVERT_EXPRvector long long int(D.6891_14);
  D.6897_16 = VIEW_CONVERT_EXPRvector char(D.6890_15);
  D.6896_17 = __builtin_ia32_pmovmskb128 (D.6897_16);
  D.6933_21 = D.6896_17 != 65535;
  return D.6933_21;


x is completely gone.

The (relevant) assembly output is 

main:
movdqa  .LC0, %xmm0
pcmpeqd %xmm0, %xmm0
pmovmskb%xmm0, %eax
cmpl$65535, %eax
pushl   %ebp
setne   %al
movl%esp, %ebp
movzbl  %al, %eax
popl%ebp
ret

So  even though  I  don't  really understand  the  SSE instructions  I
believe the  new SRA does indeed  help.  I'll add  a testcase checking
that x vanishes to the patch series as I am finalizing the final patch
set now.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40122



[Bug tree-optimization/40323] [4.5 Regression] compiling just takes forever and doesn't really process

2009-06-02 Thread jamborm at gcc dot gnu dot org


--- Comment #6 from jamborm at gcc dot gnu dot org  2009-06-02 10:51 ---
Apparently I was not careful enough when turning an if branch to a while loop. 
I'll prepare and test a patch straight away.


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |jamborm at gcc dot gnu dot
   |dot org |org
 Status|NEW |ASSIGNED
   Last reconfirmed|2009-06-02 10:45:24 |2009-06-02 10:51:47
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40323



[Bug tree-optimization/40323] [4.5 Regression] compiling just takes forever and doesn't really process

2009-06-02 Thread jamborm at gcc dot gnu dot org


--- Comment #7 from jamborm at gcc dot gnu dot org  2009-06-02 17:06 ---
Created an attachment (id=17946)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17946action=view)
Fix

Ok, creating a simple testcase was not easy for me but here is a patch
that includes one (and fixes the original issue too).  It still needs
testing but I am quite confident it will pass.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40323



[Bug tree-optimization/40323] [4.5 Regression] compiling just takes forever and doesn't really process

2009-06-03 Thread jamborm at gcc dot gnu dot org


--- Comment #8 from jamborm at gcc dot gnu dot org  2009-06-03 11:56 ---
Subject: Bug 40323

Author: jamborm
Date: Wed Jun  3 11:56:05 2009
New Revision: 148126

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=148126
Log:
2009-06-03  Martin Jambor  mjam...@suse.cz

PR tree-optimization/40323
* ipa-prop.c (get_ssa_def_if_simple_copy): Break if not single
assignment.

* testsuite/g++.dg/torture/pr40323.C: New file.


Added:
trunk/gcc/testsuite/g++.dg/torture/pr40323.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/ipa-prop.c
trunk/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40323



[Bug tree-optimization/40323] [4.5 Regression] compiling just takes forever and doesn't really process

2009-06-03 Thread jamborm at gcc dot gnu dot org


--- Comment #9 from jamborm at gcc dot gnu dot org  2009-06-03 12:54 ---
I have just verified this is fixed on the current trunk.


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40323



[Bug tree-optimization/40351] [4.5 Regression] ice in generate_subtree_copies for Linux kernel build

2009-06-05 Thread jamborm at gcc dot gnu dot org


--- Comment #4 from jamborm at gcc dot gnu dot org  2009-06-05 15:48 ---
Created an attachment (id=17955)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17955action=view)
Fix

This patch fixes this problem.  I'll post it to the mailing list once
I get to bootstrap it which may take a while now.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40351



[Bug middle-end/32950] [4.5 regression] ICE with __complex__ double

2009-06-07 Thread jamborm at gcc dot gnu dot org


--- Comment #15 from jamborm at gcc dot gnu dot org  2009-06-07 14:41 
---
(In reply to comment #11)
 It is caused by revision 147980:
 
 http://gcc.gnu.org/ml/gcc-cvs/2009-05/msg00959.html
 

Revision 147978 also does not work if you compile the testcase with
the -fno-tree-sra switch.

New SRA uncovers this problem because it sees the structure containing
only a  single field  always accessed  as a structure  and never  as a
scalar and so  does not scalarize it.  Something  goes wrong later on,
probably when  expanding to RTL.  Unfortunately, I  cannot help fixing
that.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32950



[Bug c/40378] ICE starting with revision 147980

2009-06-08 Thread jamborm at gcc dot gnu dot org


--- Comment #3 from jamborm at gcc dot gnu dot org  2009-06-08 13:27 ---
This is obviously mine.  Will look into it shortly.


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |jamborm at gcc dot gnu dot
   |dot org |org
 Status|UNCONFIRMED |ASSIGNED
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2009-06-08 13:27:52
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40378



[Bug middle-end/32950] [4.5 regression] ICE with __complex__ double

2009-06-08 Thread jamborm at gcc dot gnu dot org


--- Comment #17 from jamborm at gcc dot gnu dot org  2009-06-08 17:49 
---
(In reply to comment #16)
 Wait, (In reply to comment #15)
  (In reply to comment #11)
   It is caused by revision 147980:
   
   http://gcc.gnu.org/ml/gcc-cvs/2009-05/msg00959.html
   
  
  Revision 147978 also does not work if you compile the testcase with
  the -fno-tree-sra switch.
  
  New SRA uncovers this problem because it sees the structure containing
  only a  single field  always accessed  as a structure  and never  as a
  scalar and so  does not scalarize it.  Something  goes wrong later on,
  probably when  expanding to RTL.  Unfortunately, I  cannot help fixing
  that.
 
 I think that should always scalarize as it is a single field as it is always
 better to scalarize single field structs (except maybe bitfield ones).

Well, Richi seems to disagree:

http://gcc.gnu.org/ml/gcc-patches/2009-06/msg00637.html

I am not  sure myself, I believe  that there are not so  many cases in
which  this would  prove  beneficial.  When  there  are no  operations
performed on the  scalars, the only situation I can  think of would be
some extensive copy propagation.

Martin


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32950



[Bug tree-optimization/40351] [4.5 Regression] ice in generate_subtree_copies for Linux kernel build

2009-06-09 Thread jamborm at gcc dot gnu dot org


--- Comment #6 from jamborm at gcc dot gnu dot org  2009-06-09 16:53 ---
Subject: Bug 40351

Author: jamborm
Date: Tue Jun  9 16:52:57 2009
New Revision: 148315

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=148315
Log:
2009-06-09  Martin Jambor  mjam...@suse.cz

PR tree-optimization/40351
* tree-sra.c (propagate_subacesses_accross_link): Check that a refrence
to a potential artifical subaccess can be constructed.

* testsuite/gcc.c-torture/compile/pr40351.c: New file.


Added:
trunk/gcc/testsuite/gcc.c-torture/compile/pr40351.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-sra.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40351



[Bug tree-optimization/40351] [4.5 Regression] ice in generate_subtree_copies for Linux kernel build

2009-06-09 Thread jamborm at gcc dot gnu dot org


--- Comment #7 from jamborm at gcc dot gnu dot org  2009-06-09 20:59 ---
Fixed.


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40351



[Bug tree-optimization/40413] [4.5 Regression] Internal error in connection with optimization and allocatable objects

2009-06-13 Thread jamborm at gcc dot gnu dot org


--- Comment #8 from jamborm at gcc dot gnu dot org  2009-06-14 01:30 ---
Mine, will look into it shortly.


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |jamborm at gcc dot gnu dot
   |dot org |org
 Status|NEW |ASSIGNED
   Last reconfirmed|2009-06-12 05:20:52 |2009-06-14 01:30:09
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40413



[Bug rtl-optimization/33928] [4.3/4.4/4.5 Regression] 30% performance slowdown in floating-point code caused by r118475

2009-06-13 Thread jamborm at gcc dot gnu dot org


--- Comment #94 from jamborm at gcc dot gnu dot org  2009-06-14 04:43 
---
(In reply to comment #92)
 In the meanwhile something caused tree incremental SSA to jump up from 10s 
 to
 26s.  Sob.
 

(In reply to comment #93)
 I would say that was the new SRA.
 

OK, I'll try to investigate.  Which of the various attachments to this
bug is the one to look at?

Martin


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33928



[Bug tree-optimization/40432] [4.5 Regression] verify_stmts failed with -O2: non-register as LHS of unary operation

2009-06-13 Thread jamborm at gcc dot gnu dot org


--- Comment #3 from jamborm at gcc dot gnu dot org  2009-06-14 04:55 ---
(In reply to comment #1)
 I want to say the SRA changes caused this ...
 

Yes it did.  I can reproduce it and it should not be difficult to
fix.  However, I'll have a look at why SRA constructs such a statement
in the first place.  The code that does it currently things it's
either appending .eh to the LHS or the VCE to the RHS, not both.
But maybe it's just an oversight, I'll check in the morning.


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |jamborm at gcc dot gnu dot
   |dot org |org
 Status|UNCONFIRMED |ASSIGNED
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2009-06-14 04:55:06
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40432



[Bug tree-optimization/40413] [4.5 Regression] Internal error in connection with optimization and allocatable objects

2009-06-15 Thread jamborm at gcc dot gnu dot org


--- Comment #9 from jamborm at gcc dot gnu dot org  2009-06-15 09:07 ---
Created an attachment (id=18001)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18001action=view)
Fix

This was quite a serious oversight on my part, I wonder how it went
for so long unnoticed.  I am about to bootstrap and regression test
this patch and will submit it if both succeed.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40413



[Bug tree-optimization/40432] [4.5 Regression] verify_stmts failed with -O2: non-register as LHS of unary operation

2009-06-15 Thread jamborm at gcc dot gnu dot org


--- Comment #4 from jamborm at gcc dot gnu dot org  2009-06-15 09:09 ---
Created an attachment (id=18002)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18002action=view)
Fix

OK, the  statement is fine  except that it  is not gimple  ;-).  Fixed
with this patch, I will submit it if it passes bootstrap and testing.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40432



[Bug tree-optimization/40413] [4.5 Regression] Internal error in connection with optimization and allocatable objects

2009-06-16 Thread jamborm at gcc dot gnu dot org


--- Comment #10 from jamborm at gcc dot gnu dot org  2009-06-16 09:54 
---
Bootstrap and testing passed, submitted in
http://gcc.gnu.org/ml/gcc-patches/2009-06/msg01179.html


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40413



[Bug tree-optimization/40432] [4.5 Regression] verify_stmts failed with -O2: non-register as LHS of unary operation

2009-06-16 Thread jamborm at gcc dot gnu dot org


--- Comment #5 from jamborm at gcc dot gnu dot org  2009-06-16 09:57 ---
Bootstrapped, tested, submitted in
http://gcc.gnu.org/ml/gcc-patches/2009-06/msg01182.html


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40432



[Bug tree-optimization/40413] [4.5 Regression] Internal error in connection with optimization and allocatable objects

2009-06-16 Thread jamborm at gcc dot gnu dot org


--- Comment #11 from jamborm at gcc dot gnu dot org  2009-06-16 10:12 
---
Subject: Bug 40413

Author: jamborm
Date: Tue Jun 16 10:11:55 2009
New Revision: 148520

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=148520
Log:
2009-06-16  Martin Jambor  mjam...@suse.cz

PR tree-optimization/40413
* tree-sra.c (load_assign_lhs_subreplacements): Pass offset to
build_ref_for_offset.
(propagate_subacesses_accross_link): Fix a typo in a comment.

* testsuite/gfortran.fortran-torture/compile/pr40413.f90: New file.


Added:
trunk/gcc/testsuite/gfortran.fortran-torture/compile/pr40413.f90
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-sra.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40413



[Bug tree-optimization/40432] [4.5 Regression] verify_stmts failed with -O2: non-register as LHS of unary operation

2009-06-16 Thread jamborm at gcc dot gnu dot org


--- Comment #6 from jamborm at gcc dot gnu dot org  2009-06-16 10:16 ---
Subject: Bug 40432

Author: jamborm
Date: Tue Jun 16 10:16:40 2009
New Revision: 148522

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=148522
Log:
2009-06-16  Martin Jambor  mjam...@suse.cz

PR tree-optimization/40432
* tree-sra.c (sra_modify_assign): When creating VIEW_CONVERT_EXPR,
check whether we need to force gimple register operand.

* testsuite/gcc.c-torture/compile/pr40432.c: New file.



Added:
trunk/gcc/testsuite/gcc.c-torture/compile/pr40432.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-sra.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40432



[Bug tree-optimization/40432] [4.5 Regression] verify_stmts failed with -O2: non-register as LHS of unary operation

2009-06-16 Thread jamborm at gcc dot gnu dot org


--- Comment #7 from jamborm at gcc dot gnu dot org  2009-06-16 10:24 ---
Fixed.


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40432



[Bug tree-optimization/40413] [4.5 Regression] Internal error in connection with optimization and allocatable objects

2009-06-16 Thread jamborm at gcc dot gnu dot org


--- Comment #12 from jamborm at gcc dot gnu dot org  2009-06-16 10:24 
---
Fixed


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40413



[Bug c++/40492] [4.5 Regression] ice in create_tmp_var

2009-06-19 Thread jamborm at gcc dot gnu dot org


--- Comment #3 from jamborm at gcc dot gnu dot org  2009-06-19 13:14 ---
(In reply to comment #2)
 Confirmed.  Caused by new SRA - we are creating a temporary with
 TREE_ADDRESSABLE
 type.
 

Again?   Well, let me see where...


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |jamborm at gcc dot gnu dot
   |dot org |org
 Status|NEW |ASSIGNED
   Last reconfirmed|2009-06-19 12:37:49 |2009-06-19 13:14:43
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40492



[Bug c++/40492] [4.5 Regression] ice in create_tmp_var

2009-06-19 Thread jamborm at gcc dot gnu dot org


--- Comment #4 from jamborm at gcc dot gnu dot org  2009-06-19 17:27 ---
Created an attachment (id=18025)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18025action=view)
Fix

The offset we pass to build_ref_for_offset in sra_modify_assign does not make
any sense.  I am about to bootstrap and test the attached patch which fixes
this problem.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40492



[Bug middle-end/40493] [4.5 Regression] New SRA miscompiled binutils

2009-06-19 Thread jamborm at gcc dot gnu dot org


--- Comment #1 from jamborm at gcc dot gnu dot org  2009-06-19 18:09 ---
I will look into this next week.  However, I have never compiled binutils
before, so unless it is obvious, please describe how to reproduce the problem.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40493



[Bug c++/40492] [4.5 Regression] ice in create_tmp_var

2009-06-22 Thread jamborm at gcc dot gnu dot org


--- Comment #5 from jamborm at gcc dot gnu dot org  2009-06-22 10:54 ---
Subject: Bug 40492

Author: jamborm
Date: Mon Jun 22 10:54:16 2009
New Revision: 148787

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=148787
Log:
2009-06-22  Martin Jambor  mjam...@suse.cz

PR tree-optimization/40492
* tree-sra.c (sra_modify_assign): Pass zero offsets to
build_ref_for_offset.

* testsuite/g++.dg/torture/pr40492.C: New test. 


Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-sra.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40492



[Bug middle-end/40493] [4.5 Regression] New SRA miscompiled binutils

2009-06-22 Thread jamborm at gcc dot gnu dot org


--- Comment #9 from jamborm at gcc dot gnu dot org  2009-06-22 18:57 ---
Right, now I can reproduce the problem and it indeed is introduced by the new
SRA commit.  None of the fixes I have done so far deals with this one either. I
am investigating this further (but don't hold your breath, it is going to take
me a while).


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |jamborm at gcc dot gnu dot
   |dot org |org
 Status|UNCONFIRMED |ASSIGNED
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2009-06-22 18:57:00
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40493



[Bug middle-end/40493] [4.5 Regression] New SRA miscompiled binutils

2009-06-23 Thread jamborm at gcc dot gnu dot org


--- Comment #10 from jamborm at gcc dot gnu dot org  2009-06-23 13:21 
---
The miscompiled file seems to be gas/tc-i386.o.  Early SRA is enough to trigger
the problem.  Digging deeper...


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40493



[Bug c++/40492] [4.5 Regression] ice in create_tmp_var

2009-06-23 Thread jamborm at gcc dot gnu dot org


--- Comment #7 from jamborm at gcc dot gnu dot org  2009-06-23 14:12 ---
Fixed


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40492



[Bug middle-end/40493] [4.5 Regression] New SRA miscompiled binutils

2009-06-23 Thread jamborm at gcc dot gnu dot org


--- Comment #12 from jamborm at gcc dot gnu dot org  2009-06-23 16:45 
---
Reduced testcase:

extern void abort (void);

typedef union i386_operand_type
{
  struct
{
  unsigned int reg8:1;
  unsigned int reg16:1;
  unsigned int reg32:1;
  unsigned int reg64:1;
  unsigned int floatreg:1;
  unsigned int regmmx:1;
  unsigned int regxmm:1;
  unsigned int regymm:1;
  unsigned int control:1;
  unsigned int debug:1;
  unsigned int test:1;
  unsigned int sreg2:1;
  unsigned int sreg3:1;
  unsigned int imm1:1;
  unsigned int imm8:1;
  unsigned int imm8s:1;
  unsigned int imm16:1;
  unsigned int imm32:1;
  unsigned int imm32s:1;
  unsigned int imm64:1;
  unsigned int disp8:1;
  unsigned int disp16:1;
  unsigned int disp32:1;
  unsigned int disp32s:1;
  unsigned int disp64:1;
  unsigned int acc:1;
  unsigned int floatacc:1;
  unsigned int baseindex:1;
  unsigned int inoutportreg:1;
  unsigned int shiftcount:1;
  unsigned int jumpabsolute:1;
  unsigned int esseg:1;
  unsigned int regmem:1;
  unsigned int mem:1;
  unsigned int byte:1;
  unsigned int word:1;
  unsigned int dword:1;
  unsigned int fword:1;
  unsigned int qword:1;
  unsigned int tbyte:1;
  unsigned int xmmword:1;
  unsigned int ymmword:1;
  unsigned int unspecified:1;
  unsigned int anysize:1;
} bitfield;
  unsigned int array[2];
} i386_operand_type;

unsigned int x00, x01, y00, y01;

int main (int argc, char *argv[])
{
  i386_operand_type a,b,c,d;

  a.bitfield.reg16 = 1;
  a.bitfield.imm16 = 0;
  a.array[1] = 22;

  b = a;
  x00 = b.array[0];
  x01 = b.array[1];

  c = b;
  y00 = c.array[0];
  y01 = c.array[1];

  d = c;
  if (d.bitfield.reg16 != 1)
abort();
  if (d.bitfield.imm16 != 0)
abort();
  if (d.array[1] != 22)
abort();

  return 0;
}


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40493



[Bug middle-end/40493] [4.5 Regression] New SRA miscompiled binutils

2009-06-24 Thread jamborm at gcc dot gnu dot org


--- Comment #13 from jamborm at gcc dot gnu dot org  2009-06-24 16:38 
---
Fix submitted to the mailing list, pending maintainer approval:
http://gcc.gnu.org/ml/gcc-patches/2009-06/msg01918.html


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40493



[Bug middle-end/40493] [4.5 Regression] New SRA miscompiled binutils

2009-06-25 Thread jamborm at gcc dot gnu dot org


--- Comment #14 from jamborm at gcc dot gnu dot org  2009-06-25 10:38 
---
Subject: Bug 40493

Author: jamborm
Date: Thu Jun 25 10:38:13 2009
New Revision: 148941

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=148941
Log:
2009-06-25  Martin Jambor  mjam...@suse.cz

PR tree-optimization/40493
* tree-sra.c (sra_modify_expr): Correct BIT_FIELD_REF argument numbers.
(enum unscalarized_data_handling): New type.
(handle_unscalarized_data_in_subtree): Return what has been done.
(load_assign_lhs_subreplacements): Handle left flushes differently.
(sra_modify_assign): Use unscalarized_data_handling, simplified
condition determining whether to remove the statement.

* testsuite/gcc.c-torture/execute/pr40493.c: New test.


Added:
trunk/gcc/testsuite/gcc.c-torture/execute/pr40493.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-sra.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40493



[Bug middle-end/40493] [4.5 Regression] New SRA miscompiled binutils

2009-06-25 Thread jamborm at gcc dot gnu dot org


--- Comment #15 from jamborm at gcc dot gnu dot org  2009-06-25 14:21 
---
I have checked out trunk 148941, compiled binutils with it (configured
with --disable-werror), ran the testsuite and there were no failures.
Thus I consider this fixed.


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40493



[Bug tree-optimization/40556] [4.5 Regression] ICE in IPA-CP with recursion

2009-06-26 Thread jamborm at gcc dot gnu dot org


--- Comment #2 from jamborm at gcc dot gnu dot org  2009-06-26 13:53 ---
This is some sort of cgraph consistency check.  Honza added it and he also said
he will look into this :-)


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||jh at suse dot cz


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40556



[Bug middle-end/40554] [4.5 Regression] Revision 148941 miscompiled 447.dealII in SPEC CPU 2006

2009-06-26 Thread jamborm at gcc dot gnu dot org


--- Comment #1 from jamborm at gcc dot gnu dot org  2009-06-26 14:59 ---
OK, I have finally managed to reproduce this and the patch does indeed result
into a segfault.  I will keep looking into this, even though probably won't be
able to do much until Monday.


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 CC|mjambor at suse dot cz  |jamborm at gcc dot gnu dot
   ||org
 AssignedTo|unassigned at gcc dot gnu   |jamborm at gcc dot gnu dot
   |dot org |org
 Status|UNCONFIRMED |ASSIGNED
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2009-06-26 14:59:53
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40554



[Bug middle-end/40554] [4.5 Regression] Revision 148941 miscompiled 447.dealII in SPEC CPU 2006

2009-06-26 Thread jamborm at gcc dot gnu dot org


--- Comment #2 from jamborm at gcc dot gnu dot org  2009-06-26 15:08 ---
The miscompiled file seems to be derivative_approximation.o


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40554



[Bug middle-end/40554] [4.5 Regression] Revision 148941 miscompiled 447.dealII in SPEC CPU 2006

2009-06-27 Thread jamborm at gcc dot gnu dot org


--- Comment #3 from jamborm at gcc dot gnu dot org  2009-06-27 23:41 ---
I believe the  following (but yet untested) patch  fixes this issue.
I will bootstrap  and test it once I have a  testcase that is simple
enough to be  put into the testsuite.   I hope to do all  of this on
Monday.


Index: mine/gcc/tree-sra.c
===
--- mine.orig/gcc/tree-sra.c2009-06-28 00:58:23.0 +0200
+++ mine/gcc/tree-sra.c 2009-06-28 01:00:34.0 +0200
@@ -1908,7 +1908,8 @@ sra_modify_expr (tree *expr, gimple_stmt
   host_integerp (TREE_OPERAND (bfr, 2), 1))
{
  chunk_size = tree_low_cst (TREE_OPERAND (bfr, 1), 1);
- start_offset = tree_low_cst (TREE_OPERAND (bfr, 2), 1);
+ start_offset = access-offset
+   + tree_low_cst (TREE_OPERAND (bfr, 2), 1);
}
   else
start_offset = chunk_size = 0;


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40554



[Bug tree-optimization/40582] [4.5 Regression] ice for non-trivial conversion at assignment with -O2

2009-06-29 Thread jamborm at gcc dot gnu dot org


--- Comment #3 from jamborm at gcc dot gnu dot org  2009-06-29 11:16 ---
OK, I'll have a look at it after I am done with PR 40554.


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |jamborm at gcc dot gnu dot
   |dot org |org
 Status|NEW |ASSIGNED
   Last reconfirmed|2009-06-29 11:10:17 |2009-06-29 11:16:14
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40582



[Bug tree-optimization/40570] [4.5 Regression] ice in get_constraint_for_ptr_offset with -O3

2009-06-29 Thread jamborm at gcc dot gnu dot org


--- Comment #4 from jamborm at gcc dot gnu dot org  2009-06-29 11:22 ---
I'm quite confident this is a cgraph bug = CCing honza.  (I'll try to keep
this on my radar but there are other issues for which I am certainly
responsible now). 


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||jh at suse dot cz


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40570



[Bug tree-optimization/40582] [4.5 Regression] ice for non-trivial conversion at assignment with -O2

2009-06-29 Thread jamborm at gcc dot gnu dot org


--- Comment #5 from jamborm at gcc dot gnu dot org  2009-06-29 17:11 ---
Created an attachment (id=18094)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18094action=view)
Fix

It turns  out that build_ref_for_offset apparently needs  to check for
full type compatibility and  node just for useless_conversions.  It is
used  more generally but  also in  much stricter  same-type conditions
than I have originally intended to.

I will test this fix (alongside with another one) overnight and submit
it tomorrow if everything goes fine.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40582



[Bug tree-optimization/40582] [4.5 Regression] ice for non-trivial conversion at assignment with -O2

2009-06-30 Thread jamborm at gcc dot gnu dot org


--- Comment #8 from jamborm at gcc dot gnu dot org  2009-06-30 11:39 ---
As you may have noticed, I changed the testcase a little bit so that
it ICEs as my i386 desktop too.  A freshly checked out trunk no longer
does.   So I believe this is indeed fixed.


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40582



[Bug middle-end/40554] [4.5 Regression] Revision 148941 miscompiled 447.dealII in SPEC CPU 2006

2009-06-30 Thread jamborm at gcc dot gnu dot org


--- Comment #6 from jamborm at gcc dot gnu dot org  2009-06-30 11:44 ---
When compiled with a freshly  checked-out trunk the testcase no longer
segfaults and gives exactly the  same output as if compiled with trunk
revision 147978 (i.e.  just before my new SRA got  in).  So I consider
this fixed and hope that various automated testers will agree.


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40554



[Bug tree-optimization/41740] [4.5 Regression] ICE in ipcp_analyze_node, at ipa-cp.c:183

2009-10-20 Thread jamborm at gcc dot gnu dot org


--- Comment #8 from jamborm at gcc dot gnu dot org  2009-10-20 10:11 ---
This looks like PR 40556.


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 CC|mjambor at suse dot cz  |jamborm at gcc dot gnu dot
   ||org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41740



[Bug tree-optimization/41775] [4.5 Regression] IPA-SRA: ice in rewrite_stmt, at tree-into-ssa.c:1302

2009-10-21 Thread jamborm at gcc dot gnu dot org


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |jamborm at gcc dot gnu dot
   |dot org |org
 Status|NEW |ASSIGNED
   Last reconfirmed|2009-10-21 12:31:40 |2009-10-21 15:05:11
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41775



[Bug tree-optimization/41775] [4.5 Regression] IPA-SRA: ice in rewrite_stmt, at tree-into-ssa.c:1302

2009-10-26 Thread jamborm at gcc dot gnu dot org


--- Comment #3 from jamborm at gcc dot gnu dot org  2009-10-26 21:53 ---
Created an attachment (id=18903)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18903action=view)
Proposed fix

Indeed, the users of build_ref_for_offset in ipa-prop.c and ipa-cp.c
do not unshare the base expressions they should.  I have looked at all
other users and found that they either pass declarations or do their
own unsharing and so decided to move the unsharing to
build_ref_for_offset itself.  The attached patch fixes the ICE when
compiling the testcase, I am currently bootstrapping it.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41775



[Bug lto/41767] assertion in tree-sra.c

2009-10-27 Thread jamborm at gcc dot gnu dot org


--- Comment #6 from jamborm at gcc dot gnu dot org  2009-10-27 13:59 ---
The problem here is that build_ref_for_offset_1() cannot find a field
corresponding to a replacement within its own aggregate.  The field is
identified by its offset (zero) and type.  Unfortunately,
types_compatible_p() claims that the type of the replacement (taken
from the expression where it occurs) and the field at the offset are
not compatible.  I have added some dumps to the beginning of the
function and got:

--
picked field value

Determining compatibility of types:

Expected type (type of the scalar replacement):
 pointer_type 0xb7726514
type union_type 0xb772612c tree_node SI
size integer_cst 0xb7687498 constant 32
unit size integer_cst 0xb7687284 constant 4
align 32 symtab 0 alias set -1 canonical type 0xb772612c
fields field_decl 0xb76eee60 common type record_type 0xb7720b54
tree_common
SI file b.h line 8 col 20 size integer_cst 0xb7687498 32 unit
size integer_cst 0xb7687284 4
align 32 offset_align 128
offset integer_cst 0xb76872a0 constant 0
bit offset integer_cst 0xb7687700 constant 0 context union_type
0xb772612c tree_node chain field_decl 0xb76eef18 constructor
pointer_to_this pointer_type 0xb7726514
unsigned SI size integer_cst 0xb7687498 32 unit size integer_cst
0xb7687284 4
align 32 symtab 0 alias set 4 canonical type 0xb7726514


Record field type:
 pointer_type 0xb7720e10
type union_type 0xb7720af0 tree_node SI
size integer_cst 0xb7687498 constant 32
unit size integer_cst 0xb7687284 constant 4
align 32 symtab 0 alias set -1 canonical type 0xb7720af0
fields field_decl 0xb76eebdc common type record_type 0xb7720b54
tree_common
SI file b.h line 8 col 20 size integer_cst 0xb7687498 32 unit
size integer_cst 0xb7687284 4
align 32 offset_align 128
offset integer_cst 0xb76872a0 constant 0
bit offset integer_cst 0xb7687700 constant 0 context union_type
0xb7720af0 tree_node chain field_decl 0xb76eec94 constructor
pointer_to_this pointer_type 0xb7720e10
unsigned SI size integer_cst 0xb7687498 32 unit size integer_cst
0xb7687284 4
align 32 symtab 0 alias set 3 canonical type 0xb7720e10


NOT compatible.

--

I could workaround this and check whether all replacements can be
located within their aggregates before creating them but that does not
sound right.  Instead I think that the bug is either somewhere in type
merging or in types_compatible_p().


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41767



[Bug tree-optimization/41775] [4.5 Regression] IPA-SRA: ice in rewrite_stmt, at tree-into-ssa.c:1302

2009-10-27 Thread jamborm at gcc dot gnu dot org


--- Comment #4 from jamborm at gcc dot gnu dot org  2009-10-27 18:04 ---
I have just sent the patch to the mailing list:

http://gcc.gnu.org/ml/gcc-patches/2009-10/msg01625.html

I had to change the testcase a bit so that it compiles on x86_64.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41775



[Bug lto/41767] assertion in tree-sra.c

2009-10-27 Thread jamborm at gcc dot gnu dot org


--- Comment #9 from jamborm at gcc dot gnu dot org  2009-10-27 18:39 ---
Hi,

(In reply to comment #7)
 Maybe IPA SRA gets
 those two types from unrelated places?
 

I believe they are quite elated.  The body of the function is:

bb 2:
  init = c_parser_initializer (0B); [return slot optimization]
  init$value_5 = init.value;
  finish_decl (0, 0, init$value_5, 0, 0);
  return;

The expected type is type of the RHS of the second statement
init.value while the type I get is the type of value within init.

 As I said the testcase has two incompatible variants of union tree_node and
 they are obviously not merged and thus not compatible. 

I was not sure whether you were implying that the input was invalid or
not.  If it is and we want to avoid the ICE in the simplest possible
way, we can do so with the patch below.  (Of course, we might try to
instead warn or fail in some nicer way when putting the individual
pieces from different files together.)

Index: mine/gcc/tree-sra.c
===
--- mine.orig/gcc/tree-sra.c
+++ mine/gcc/tree-sra.c
@@ -1644,7 +1644,13 @@ analyze_access_subtree (struct access *r

   if (allow_replacements  scalar  !root-first_child
(root-grp_hint
- || (direct_read  root-grp_write)))
+ || (direct_read  root-grp_write))
+  /* If the user provided erroneous LTO intput, we might end up ICIng as
+in PR 41767.  Prevent that by checking we can always find the part of
+the aggregate that corresponds to the replacement.  */
+   (!in_lto_p
+ || build_ref_for_offset (NULL, TREE_TYPE (root-base),
+  root-offset, root-type, false)))
 {
   if (dump_file  (dump_flags  TDF_DETAILS))
{


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41767



[Bug tree-optimization/41750] [4.5 Regression] gcc 4.5.0 miscompiles binutils

2009-10-27 Thread jamborm at gcc dot gnu dot org


--- Comment #19 from jamborm at gcc dot gnu dot org  2009-10-27 18:45 
---
I have downloaded binutils 2.20 and compiled the file on a native ia64
compiler.  I have only managed to look at the dumps but so far could
not see any problem there.  I will have another look on Thursday.


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |jamborm at gcc dot gnu dot
   |dot org |org
 Status|NEW |ASSIGNED
   Last reconfirmed|2009-10-26 20:57:48 |2009-10-27 18:45:46
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41750



[Bug tree-optimization/41775] [4.5 Regression] IPA-SRA: ice in rewrite_stmt, at tree-into-ssa.c:1302

2009-10-29 Thread jamborm at gcc dot gnu dot org


--- Comment #6 from jamborm at gcc dot gnu dot org  2009-10-29 12:41 ---
Subject: Bug 41775

Author: jamborm
Date: Thu Oct 29 12:40:48 2009
New Revision: 153699

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=153699
Log:
2009-10-29  Martin Jambor  mjam...@suse.cz

PR tree-optimization/41775
* tree-sra.c (build_ref_for_offset): Unshare *expr if not NULL.
(generate_subtree_copies): Do not unshare agg.
(load_assign_lhs_subreplacements): Do not unshare rhs.
(sra_modify_assign): Do not unshare exprs.
(propagate_subacesses_accross_link): Renamed to
propagate_subaccesses_across_link.

* testsuite/g++.dg/torture/pr41775.C: New testcase.



Added:
trunk/gcc/testsuite/g++.dg/torture/pr41775.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-sra.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41775



[Bug tree-optimization/41775] [4.5 Regression] IPA-SRA: ice in rewrite_stmt, at tree-into-ssa.c:1302

2009-10-29 Thread jamborm at gcc dot gnu dot org


--- Comment #7 from jamborm at gcc dot gnu dot org  2009-10-29 12:50 ---
I did.  This is now fixed.


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41775



[Bug tree-optimization/41750] [4.5 Regression] gcc 4.5.0 miscompiles binutils

2009-10-29 Thread jamborm at gcc dot gnu dot org


--- Comment #21 from jamborm at gcc dot gnu dot org  2009-10-29 13:44 
---
(In reply to comment #20)
 I'm not sure, but by my impression that's a host issue, no? So, I doubt that
 working on target will get you any further.
 

Perhaps, I don't know (or do you mean that you know that the native
compiler does not have this problem?).  I have also built a
cross-compiler x86_64-ia64 but when I feed the attachment in comment
#14 to it, it segfaults at -O2 regardless of -fno-ipa-sra (it
segfaults at /home/jamborm/gcc/mine/gcc/config/ia64/ia64.c:7032).

Nevertheless, I can get the IPA-SRA dump file from the cross compiler
and it is (as I belive it should be) almost identical to the one from
the native compiler and I still don't see any problem there.  I admit
that at the moment I am not sure what to look at next...


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41750



[Bug tree-optimization/41750] [4.5 Regression] IPA-SRA is broken

2009-10-30 Thread jamborm at gcc dot gnu dot org


--- Comment #24 from jamborm at gcc dot gnu dot org  2009-10-30 18:22 
---
Thanks for the simple testcase, it has certainly helped me.  I have
sent a patch to address this issue to the mailing list:

http://gcc.gnu.org/ml/gcc-patches/2009-10/msg01814.html


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41750



[Bug tree-optimization/41750] [4.5 Regression] IPA-SRA is broken

2009-11-02 Thread jamborm at gcc dot gnu dot org


--- Comment #25 from jamborm at gcc dot gnu dot org  2009-11-02 14:14 
---
Subject: Bug 41750

Author: jamborm
Date: Mon Nov  2 14:13:49 2009
New Revision: 153809

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=153809
Log:
2009-11-02  Martin Jambor  mjam...@suse.cz

PR tree-optimization/41750
* tree-sra.c (analyze_modified_params): Loop over all
representatives of components of a parameter.

* testsuite/gcc.c-torture/execute/pr41750.c: New test.


Added:
trunk/gcc/testsuite/gcc.c-torture/execute/pr41750.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-sra.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41750



[Bug tree-optimization/41750] [4.5 Regression] IPA-SRA is broken

2009-11-02 Thread jamborm at gcc dot gnu dot org


--- Comment #26 from jamborm at gcc dot gnu dot org  2009-11-02 14:33 
---
Tthis is now fixed.


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41750



[Bug lto/41932] LTO ICE when compiling ocaml trunk (incompatible type)

2009-11-04 Thread jamborm at gcc dot gnu dot org


--- Comment #6 from jamborm at gcc dot gnu dot org  2009-11-04 16:10 ---
(In reply to comment #4)
 This is -O vs. -O2 ICE because different IPA passes are selected
 then.  I think we have a dup for this - Martin, is it somehow easy
 to avoid the ICE?
 

Well, it seems that calling ipa_initialize_node_params() rather than
ipa_populate_param_decls() in ipa_update_after_lto_read() should avoid
it.

Moreover, if things can get this much out of sync, I'd also call
ipa_check_create_node_params() and ipa_check_create_edge_args() at the
beginning of ipa_update_after_lto_read() too, just to be sure.

I have not tried any of the above but can prepare a patch along these
lines... unless someone else is faster :-)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41932



[Bug lto/41932] LTO ICE when compiling ocaml trunk (incompatible type)

2009-11-10 Thread jamborm at gcc dot gnu dot org


--- Comment #9 from jamborm at gcc dot gnu dot org  2009-11-10 16:20 ---
Proposed patch: http://gcc.gnu.org/ml/gcc-patches/2009-11/msg00501.html


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 CC|mjambor at suse dot cz  |jamborm at gcc dot gnu dot
   ||org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41932



[Bug lto/42009] New: LTO unable to link in presence of multiple inheritance

2009-11-11 Thread jamborm at gcc dot gnu dot org
The C++ testcase that I am about to attach compiles and links well
without LTO at all optimizations levels.  Unfortunately, whenever I
try to compile it with LTO (at any optimization level including zero),
I get the following link error:

mjam...@host:~/gcc/fail$ ~/gcc/inst/trunk/bin/g++ -flto testcase.cpp 
/tmp/ccxMi1Vq.lto.o:(.rodata._ZTV1B[_ZTV1B]+0x18): undefined reference to
`_ZThn16_N1B3fooEi'
collect2: ld returned 1 exit status

When I remove the first ancestor of class B from the list of
ancestors, the testcase links and works fine.

I get a very similar error on x86_64 too.  On both machines the used
compiler is pristine trunk revision 154038.


-- 
   Summary: LTO unable to link in presence of multiple inheritance
   Product: gcc
   Version: 4.5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: lto
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jamborm at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42009



[Bug lto/42009] LTO unable to link in presence of multiple inheritance

2009-11-11 Thread jamborm at gcc dot gnu dot org


--- Comment #1 from jamborm at gcc dot gnu dot org  2009-11-11 14:40 ---
Created an attachment (id=19004)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19004action=view)
Testcase

This is the testcase.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42009



[Bug lto/41932] LTO ICE when compiling ocaml trunk (incompatible type)

2009-11-11 Thread jamborm at gcc dot gnu dot org


--- Comment #10 from jamborm at gcc dot gnu dot org  2009-11-11 15:07 
---
Subject: Bug 41932

Author: jamborm
Date: Wed Nov 11 15:07:18 2009
New Revision: 154095

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=154095
Log:
2009-11-11  Martin Jambor  mjam...@suse.cz

PR lto/41932
* ipa-prop.c (ipa_update_after_lto_read): Call
ipa_check_create_node_params and ipa_check_create_edge_args.  Also
call ipa_initialize_node_params instead of ipa_populate_param_decls.


Modified:
trunk/gcc/ChangeLog
trunk/gcc/ipa-prop.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41932



[Bug lto/41932] LTO ICE when compiling ocaml trunk (incompatible type)

2009-11-11 Thread jamborm at gcc dot gnu dot org


--- Comment #11 from jamborm at gcc dot gnu dot org  2009-11-11 15:10 
---
Basile, can you please confirm that this is now fixed?  Thanks.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41932



[Bug middle-end/42025] [4.5 Regression] ICE verify_stmts failed (non-trivial conversion at assignment)

2009-11-13 Thread jamborm at gcc dot gnu dot org


--- Comment #4 from jamborm at gcc dot gnu dot org  2009-11-13 16:36 ---
This seems to be IPA SRA and thus mine.


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||jamborm at gcc dot gnu dot
   ||org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42025



[Bug middle-end/42025] [4.5 Regression] ICE verify_stmts failed (non-trivial conversion at assignment)

2009-11-13 Thread jamborm at gcc dot gnu dot org


--- Comment #5 from jamborm at gcc dot gnu dot org  2009-11-13 19:34 ---
Yep, this is definitely mine.  Even though I have a fix for the above
testcase, it unfortunately does not work for my all-time favorite
one-filed structures, e.g.: 

typedef struct
{
  void *p;
} Ptr;

struct A
{
  int i;
  union
  {
Ptr p;
char *q;
  } u;
};

extern Ptr get_stuff (void);
extern void use_stuff (char *);

static void foo(struct A p, char *q)
{
  if (p.i)
p.u.p = get_stuff ();
  else
p.u.q = q;

  use_stuff (p.u.q);
}

void bar(struct A *p, char *q)
{
  foo(*p, q);
}


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|rguenth at gcc dot gnu dot  |jamborm at gcc dot gnu dot
   |org |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42025



[Bug middle-end/42025] [4.5 Regression] ICE verify_stmts failed (non-trivial conversion at assignment)

2009-11-13 Thread jamborm at gcc dot gnu dot org


--- Comment #6 from jamborm at gcc dot gnu dot org  2009-11-13 21:13 ---
Created an attachment (id=19012)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19012action=view)
Proposed fix.

Proposed fix I am currently bootstrapping.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42025



[Bug middle-end/42025] [4.5 Regression] ICE verify_stmts failed (non-trivial conversion at assignment)

2009-11-21 Thread jamborm at gcc dot gnu dot org


--- Comment #7 from jamborm at gcc dot gnu dot org  2009-11-21 22:57 ---
Subject: Bug 42025

Author: jamborm
Date: Sat Nov 21 22:56:36 2009
New Revision: 154413

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=154413
Log:
2009-11-21  Martin Jambor  mjam...@suse.cz

PR middle-end/42025
* tree-sra.c (access_precludes_ipa_sra_p): New function.
(splice_param_accesses): Check all accesses by calling
access_precludes_ipa_sra_p.
(sra_ipa_modify_expr): Rename argument erite to dont_convert and do
not convert types if it is true.
(sra_ipa_modify_assign): Convert types in case of mismatch.

* testsuite/gcc.c-torture/compile/pr42025-1.c: New test.
* testsuite/gcc.c-torture/compile/pr42025-2.c: New test.


Added:
trunk/gcc/testsuite/gcc.c-torture/compile/pr42025-1.c
trunk/gcc/testsuite/gcc.c-torture/compile/pr42025-2.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-sra.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42025



[Bug middle-end/42025] [4.5 Regression] ICE verify_stmts failed (non-trivial conversion at assignment)

2009-11-21 Thread jamborm at gcc dot gnu dot org


--- Comment #8 from jamborm at gcc dot gnu dot org  2009-11-21 23:43 ---
Fixed.


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42025



[Bug tree-optimization/42154] [4.5 Regression] Wrong code from (early) SRA

2009-11-23 Thread jamborm at gcc dot gnu dot org


--- Comment #1 from jamborm at gcc dot gnu dot org  2009-11-23 14:01 ---
I'm looking into this.  This example shows why using access-expr to create new
expressions is a dangerous thing to do, at least in some contexts (which I did
not really realize until now). I'd better look at them all.


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |jamborm at gcc dot gnu dot
   |dot org |org
 Status|UNCONFIRMED |ASSIGNED
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2009-11-23 14:01:46
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42154



[Bug tree-optimization/42154] [4.5 Regression] Wrong code from (early) SRA

2009-11-23 Thread jamborm at gcc dot gnu dot org


--- Comment #2 from jamborm at gcc dot gnu dot org  2009-11-23 22:19 ---
Proposed patch:

http://gcc.gnu.org/ml/gcc-patches/2009-11/msg01311.html


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42154



[Bug tree-optimization/42154] [4.5 Regression] Wrong code from (early) SRA

2009-11-24 Thread jamborm at gcc dot gnu dot org


--- Comment #4 from jamborm at gcc dot gnu dot org  2009-11-24 10:56 ---
Subject: Bug 42154

Author: jamborm
Date: Tue Nov 24 10:56:14 2009
New Revision: 154493

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=154493
Log:
2009-11-24  Martin Jambor  mjam...@suse.cz

PR tree-optimization/42154
* tree-sra.c (struct access): Added comments.
(sra_modify_expr): Build references to the old aggregate with
build_ref_for_offset instead of reusing access-expr.
(load_assign_lhs_subreplacements): Likewise.

* testsuite/gcc.c-torture/execute/pr42154.c: New test.


Added:
trunk/gcc/testsuite/gcc.c-torture/execute/pr42154.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-sra.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42154



[Bug tree-optimization/42154] [4.5 Regression] Wrong code from (early) SRA

2009-11-24 Thread jamborm at gcc dot gnu dot org


--- Comment #5 from jamborm at gcc dot gnu dot org  2009-11-24 10:58 ---
Fixed.


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42154



[Bug bootstrap/42157] [4.5 regression] ICE building stage 1 libgcc on IRIX 5.3: SEGV in compare_access_positions

2009-11-24 Thread jamborm at gcc dot gnu dot org


--- Comment #1 from jamborm at gcc dot gnu dot org  2009-11-24 18:16 ---
Can you please add a check before the qsort call (tree-sra.c, line
1407) whether all pointers in the access_vec seem OK or whether it is
SRA that passes the invalid pointer to qsort?  Nothing fancy,
something as stupid as the loop below should do:

for (i =0; i  access_count; i++)
  gcc_assert (((unsigned) VEC_index (access_p, access_vec, i))  0x1000);

If it passes I can't see any other explanation but a bad qsort.  If it
doesn't we'll need to figure out how the bad pointers get there.

I don't have access to the architecture so I can't try it myself.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42157



[Bug middle-end/41290] [4.5 regression] ICE: edge points to wrong declaration

2009-11-27 Thread jamborm at gcc dot gnu dot org


--- Comment #11 from jamborm at gcc dot gnu dot org  2009-11-27 12:00 
---
I can't reproduce this with revision 154673.  Maybe it is fixed
already?  (perhaps by a fix for PR 42151?)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41290



[Bug middle-end/42196] New: ICE when SRAing partial assigments to complex number

2009-11-27 Thread jamborm at gcc dot gnu dot org
Not very surprisingly, I get ICEs at tree-sra.c:2148 when compiling
these two examples with the current trunk at -O[123] on x86-64-linux:

==
union U
{
  double d;
  __complex__ int c;
};

double gd;
extern double bar (union U);

double foo (int b, double d, int c1, int c2)
{
  union U u;
  double r;

  if (b)
{
  u.d = d;
  r = u.d;
}
  else
{
  __real__ u.c = c1;
  __imag__ u.c = c2;
  r = bar (u);
}

  return r;
}
==
union U
{
  __complex__ int ci;
  __complex__ float cf;
};

float gd;
extern float bar (union U);

float foo (int b, double f1, double f2, int c1, int c2)
{
  union U u;
  double r;

  if (b)
{
  __real__ u.cf = f1;
  __imag__ u.cf = f2;
}
  else
{
  __real__ u.ci = c1;
  __imag__ u.ci = c2;
}

  r = bar (u);
  return r;
}
==

Hopefully I know what needs to be done.

Martin


-- 
   Summary: ICE when SRAing partial assigments to complex number
   Product: gcc
   Version: 4.5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
AssignedTo: jamborm at gcc dot gnu dot org
ReportedBy: jamborm at gcc dot gnu dot org
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42196



[Bug middle-end/42006] [4.5 Regression] Termination problem with -O2 and -O3

2009-11-27 Thread jamborm at gcc dot gnu dot org


--- Comment #4 from jamborm at gcc dot gnu dot org  2009-11-27 18:46 ---
I have started a bootstrap and check of the following (with a testcase
and change log and stuff...) which for some reason fixes this
(renaming introduces the mess, the code as is generated by IPA-SRA is OK):

Index: mine/gcc/tree-sra.c
===
--- mine.orig/gcc/tree-sra.c
+++ mine/gcc/tree-sra.c
@@ -3478,7 +3478,10 @@ get_replaced_param_substitute (struct ip
 {
   char *pretty_name = make_fancy_name (adj-base);

-  repl = make_rename_temp (TREE_TYPE (adj-base), ISR);
+  repl = create_tmp_var (TREE_TYPE (adj-base), ISR);
+  if (TREE_CODE (TREE_TYPE (repl)) == COMPLEX_TYPE
+ || TREE_CODE (TREE_TYPE (repl)) == VECTOR_TYPE)
+   DECL_GIMPLE_REG_P (repl) = 1;
   DECL_NAME (repl) = get_identifier (pretty_name);
   obstack_free (name_obstack, pretty_name);


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42006



[Bug middle-end/42196] ICE when SRAing partial assigments to complex number

2009-11-27 Thread jamborm at gcc dot gnu dot org


--- Comment #1 from jamborm at gcc dot gnu dot org  2009-11-27 22:22 ---
Just for the record, this also fails, for similar reasons like the
second testcase above:

union U
{
  __complex__ int ci;
  __complex__ float cf;
};

float gd;
extern float bar (float, float);

float foo (int b, union U u)
{
  float f1, f2, r;

  if (b)
{
  f1 = __real__ u.cf;
  f1 = __imag__ u.cf;
}
  else
{
  f1 = __real__ u.ci;
  f1 = __imag__ u.ci;
}

  r = bar (f1, f2);
  return r;
}


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42196



[Bug middle-end/42006] [4.5 Regression] Termination problem with -O2 and -O3

2009-11-27 Thread jamborm at gcc dot gnu dot org


--- Comment #5 from jamborm at gcc dot gnu dot org  2009-11-27 22:34 ---
Subject: Bug 42006

Author: jamborm
Date: Fri Nov 27 22:34:40 2009
New Revision: 154715

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=154715
Log:
2009-11-27  Martin Jambor  mjam...@suse.cz

PR middle-end/42006
* tree-sra.c (get_replaced_param_substitute): Call create_tmp_var
instead of create_tmp_var.  Set DECL_GIMPLE_REG_P to one manually
for vector and complex types.
(get_adjustment_for_base): Describe return value in the comment.

* testsuite/gcc.c-torture/execute/pr42006.c: New test.


Added:
trunk/gcc/testsuite/gcc.c-torture/execute/pr42006.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-sra.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42006



[Bug middle-end/42006] [4.5 Regression] Termination problem with -O2 and -O3

2009-11-27 Thread jamborm at gcc dot gnu dot org


--- Comment #6 from jamborm at gcc dot gnu dot org  2009-11-27 22:35 ---
Fixed.


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42006



[Bug middle-end/42206] ipa-prop.c: use of uninitialised local data

2009-11-30 Thread jamborm at gcc dot gnu dot org


--- Comment #2 from jamborm at gcc dot gnu dot org  2009-11-30 10:36 ---
What a stupid oversight, I'll prepare a patch straight away.


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |jamborm at gcc dot gnu dot
   |dot org |org
 Status|NEW |ASSIGNED
   Last reconfirmed|2009-11-28 16:31:16 |2009-11-30 10:36:59
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42206



[Bug middle-end/42206] ipa-prop.c: use of uninitialised local data

2009-11-30 Thread jamborm at gcc dot gnu dot org


--- Comment #3 from jamborm at gcc dot gnu dot org  2009-11-30 15:46 ---
Subject: Bug 42206

Author: jamborm
Date: Mon Nov 30 15:46:00 2009
New Revision: 154820

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=154820
Log:
2009-11-30  Martin Jambor  mjam...@suse.cz

PR middle-end/42206
* ipa-prop.c (ipa_write_node_info): Initialize note_count to zero.


Modified:
trunk/gcc/ChangeLog
trunk/gcc/ipa-prop.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42206



[Bug middle-end/42206] ipa-prop.c: use of uninitialised local data

2009-11-30 Thread jamborm at gcc dot gnu dot org


--- Comment #4 from jamborm at gcc dot gnu dot org  2009-11-30 15:58 ---
The variable is initialized now.  Thanks for pointing it out.


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42206



[Bug middle-end/42196] ICE when SRAing partial assigments to complex number

2009-11-30 Thread jamborm at gcc dot gnu dot org


--- Comment #2 from jamborm at gcc dot gnu dot org  2009-11-30 18:00 ---
Subject: Bug 42196

Author: jamborm
Date: Mon Nov 30 17:59:57 2009
New Revision: 154834

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=154834
Log:
2009-11-30  Martin Jambor  mjam...@suse.cz

PR middle-end/42196
* tree-sra.c (struct access): New field grp_different_types.
(dump_access): Dump grp_different_types.
(compare_access_positions): Prefer scalars and vectors over other
scalar types.
(sort_and_splice_var_accesses): Set grp_different_types if appropriate.
(sra_modify_expr): Use the original also when dealing with a complex
 or vector group accessed as multiple types.

* testsuite/gcc.c-torture/compile/pr42196-1.c: New test.
* testsuite/gcc.c-torture/compile/pr42196-2.c: New test.
* testsuite/gcc.c-torture/compile/pr42196-3.c: New test.


Added:
trunk/gcc/testsuite/gcc.c-torture/compile/pr42196-1.c
trunk/gcc/testsuite/gcc.c-torture/compile/pr42196-2.c
trunk/gcc/testsuite/gcc.c-torture/compile/pr42196-3.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-sra.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42196



[Bug middle-end/42196] ICE when SRAing partial assigments to complex number

2009-11-30 Thread jamborm at gcc dot gnu dot org


--- Comment #3 from jamborm at gcc dot gnu dot org  2009-11-30 18:16 ---
Fixed.


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42196



[Bug tree-optimization/42231] [4.4 Regression] Wrong generated code when using a callback function (possible callback function inlining bug ?)

2009-11-30 Thread jamborm at gcc dot gnu dot org


--- Comment #6 from jamborm at gcc dot gnu dot org  2009-11-30 22:22 ---
The lattices are OK per se.  Lattices really only represent arguments
of calls that are represented in the call graph.  When there might be
other calls that are not represented in the graph, the function body
is cloned and the original should be used for those.  But it appears
it isn't.  (In fact it is always cloned because that's how replacement
with constants works.)

Specifically, the problem is that the wrong version of callback is
_inlined_ into CallFunctionRec.  Since indirect inlining is not
involved, I'm surprised that this indirect call is inlined.  So it all
comes down to the fact that we have a wrong edge in the call graph
after ipa-cp.

This happens in the following way:

1. CallFunctionRec is cloned because fun is constant.  fun is replaced
   by callback in the call statement.  It then calls rebuild
   cgraph_edges so that a call graph edge is created for the statement
   (among other things, I believe cgraph verifier mandates this).

2. callback is cloned.  IPA-CP does a rather nasty trick when
   redirecting callers:  It redirects all of them and then figures out
   later when it was wrong.  However a clone calling a clone is
   considered always safe.  That would be so, however, only if the
   edge we created in the previous cloning was also part of the
   call graph when we did our analysis.  But we added it later.

We do not have this issue in trunk at least since may because the
clone is now virtual, has no body and so we do not rebuild outgoing
call graph edges in this way.  (In fact, for the sake of indirect
inlining, we should be creating these edges too.)

Anyway, my proposed fix would be to replace the call
rebuild_cgraph_edges in ipcp_update_cloned_node with something that
just adds new call graph edges and also marks the new ones as
indirect.  Then it would be enough to tell ipcp_update_callgraph to
redirect these edges back to (hm, actually from) the original nodes as
well.

If there are no objections, I'll prepare a patch along these lines in
the next few days.


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||jh at suse dot cz


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42231



[Bug tree-optimization/42237] [4.5 Regression] internal compiler error: verify_stmts failed

2009-12-01 Thread jamborm at gcc dot gnu dot org


--- Comment #5 from jamborm at gcc dot gnu dot org  2009-12-01 13:04 ---
Right. IPA-SRA currently relies on that it can always replace a memory
reference with a memory reference.  But both sides of this assignment
were originally one field structures turned into scalars and so the
assumption does not hold.  It seems I need to detect this particular
case and handle at the same place where I fix types.


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |jamborm at gcc dot gnu dot
   |dot org |org
 Status|NEW |ASSIGNED
   Last reconfirmed|2009-12-01 11:14:34 |2009-12-01 13:04:45
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42237



[Bug tree-optimization/42237] [4.5 Regression] internal compiler error: verify_stmts failed

2009-12-01 Thread jamborm at gcc dot gnu dot org


--- Comment #6 from jamborm at gcc dot gnu dot org  2009-12-01 14:10 ---
Created an attachment (id=19197)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19197action=view)
Simple testcase

A simple test case that exhibits this bug and ICEs on both i386 and x86_64.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42237



[Bug tree-optimization/42237] [4.5 Regression] internal compiler error: verify_stmts failed

2009-12-01 Thread jamborm at gcc dot gnu dot org


--- Comment #7 from jamborm at gcc dot gnu dot org  2009-12-01 14:47 ---
Created an attachment (id=19198)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19198action=view)
Patch dealing with such assignments

I'm currently testing this patch to address the problem. 


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42237



[Bug tree-optimization/42237] [4.5 Regression] internal compiler error: verify_stmts failed

2009-12-01 Thread jamborm at gcc dot gnu dot org


--- Comment #9 from jamborm at gcc dot gnu dot org  2009-12-01 17:40 ---
Subject: Bug 42237

Author: jamborm
Date: Tue Dec  1 17:39:44 2009
New Revision: 154874

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=154874
Log:
2009-12-01  Martin Jambor  mjam...@suse.cz

PR tree-optimization/42237
* tree-sra.c (sra_ipa_modify_assign): Split gimple_reg_type assignments
in between references into two.

* testsuite/gcc.c-torture/compile/pr42237.c: New test.


Added:
trunk/gcc/testsuite/gcc.c-torture/compile/pr42237.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-sra.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42237



[Bug tree-optimization/42237] [4.5 Regression] internal compiler error: verify_stmts failed

2009-12-01 Thread jamborm at gcc dot gnu dot org


--- Comment #10 from jamborm at gcc dot gnu dot org  2009-12-01 17:49 
---
Fixed.


-- 

jamborm at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42237



[Bug bootstrap/42157] [4.5 regression] ICE building stage 1 libgcc: SEGV in compare_access_positions

2009-12-07 Thread jamborm at gcc dot gnu dot org


--- Comment #7 from jamborm at gcc dot gnu dot org  2009-12-07 14:15 ---
(In reply to comment #6)
 The problem is that the comparison of types is not anti-symmetrical:

Looking at the code, I see that we don't stabilize the sort for
integers.  Can you please try the following (and untested) patch?
Thanks.

Index: mine/gcc/tree-sra.c
===
--- mine.orig/gcc/tree-sra.c
+++ mine/gcc/tree-sra.c
@@ -1134,10 +1134,17 @@ compare_access_positions (const void *a,
TREE_CODE (f2-type) != COMPLEX_TYPE
TREE_CODE (f2-type) != VECTOR_TYPE)
return -1;
-  /* Put the integral type with the bigger precision first.  */
   else if (INTEGRAL_TYPE_P (f1-type)
INTEGRAL_TYPE_P (f2-type))
-   return TYPE_PRECISION (f1-type)  TYPE_PRECISION (f2-type) ? -1 : 1;
+   {
+ if (TYPE_PRECISION (f1-type) == TYPE_PRECISION (f2-type))
+   /* Stabilize the sort.  */
+   return TYPE_UID (f1-type) - TYPE_UID (f2-type);
+ else
+   /* Put the integral type with the bigger precision first.  */
+   return TYPE_PRECISION (f1-type)  TYPE_PRECISION (f2-type)
+ ? -1 : 1;
+   }
   /* Put any integral type with non-full precision last.  */
   else if (INTEGRAL_TYPE_P (f1-type)
(TREE_INT_CST_LOW (TYPE_SIZE (f1-type))


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42157



  1   2   3   4   5   >