[Bug tree-optimization/49963] [4.7 Regression] ICE: in abs_hwi, at hwint.c:108

2011-08-18 Thread paolo at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49963

--- Comment #12 from paolo at gcc dot gnu.org paolo at gcc dot gnu.org 
2011-08-18 11:30:50 UTC ---
Author: paolo
Date: Thu Aug 18 11:30:42 2011
New Revision: 177848

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=177848
Log:
2011-08-18  Paolo Carlini  paolo.carl...@oracle.com
Joseph Myers  jos...@codesourcery.com

PR tree-optimization/49963
* hwint.c (absu_hwi): Define.
* hwint.h (absu_hwi): Declare.
* fold-const.c (fold_plusminus_mult_expr): Use absu_hwi instead
of abs_hwi.
* tree-ssa-math-opts.c (gimple_expand_builtin_pow): Likewise.
* tree-ssa-loop-prefetch.c (prune_ref_by_group_reuse): Likewise.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/fold-const.c
trunk/gcc/hwint.c
trunk/gcc/hwint.h
trunk/gcc/tree-ssa-loop-prefetch.c
trunk/gcc/tree-ssa-math-opts.c


[Bug tree-optimization/49963] [4.7 Regression] ICE: in abs_hwi, at hwint.c:108

2011-08-18 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49963

Paolo Carlini paolo.carlini at oracle dot com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED

--- Comment #13 from Paolo Carlini paolo.carlini at oracle dot com 2011-08-18 
11:33:54 UTC ---
Fixed.


[Bug tree-optimization/49963] [4.7 Regression] ICE: in abs_hwi, at hwint.c:108

2011-08-17 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49963

Paolo Carlini paolo.carlini at oracle dot com changed:

   What|Removed |Added

 CC||rguenther at suse dot de

--- Comment #9 from Paolo Carlini paolo.carlini at oracle dot com 2011-08-17 
07:32:46 UTC ---
So, what do people think? Shall we go ahead with something like the patchlet I
attached?


[Bug tree-optimization/49963] [4.7 Regression] ICE: in abs_hwi, at hwint.c:108

2011-08-17 Thread rguenther at suse dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49963

--- Comment #10 from rguenther at suse dot de rguenther at suse dot de 
2011-08-17 11:25:02 UTC ---
On Wed, 17 Aug 2011, paolo.carlini at oracle dot com wrote:

 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49963
 
 Paolo Carlini paolo.carlini at oracle dot com changed:
 
What|Removed |Added
 
  CC||rguenther at suse dot de
 
 --- Comment #9 from Paolo Carlini paolo.carlini at oracle dot com 
 2011-08-17 07:32:46 UTC ---
 So, what do people think? Shall we go ahead with something like the patchlet I
 attached?

Sure, please post patches to gcc-patches@, bugzilla isn't the place
to get attention to them


[Bug tree-optimization/49963] [4.7 Regression] ICE: in abs_hwi, at hwint.c:108

2011-08-17 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49963

--- Comment #11 from Paolo Carlini paolo.carlini at oracle dot com 2011-08-17 
17:22:16 UTC ---
Ok, thanks, will do later today.


[Bug tree-optimization/49963] [4.7 Regression] ICE: in abs_hwi, at hwint.c:108

2011-08-10 Thread gjl at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49963

--- Comment #7 from Georg-Johann Lay gjl at gcc dot gnu.org 2011-08-10 
09:45:12 UTC ---
Is this related to PR42146, an ICE on array size of 0x8000?


[Bug tree-optimization/49963] [4.7 Regression] ICE: in abs_hwi, at hwint.c:108

2011-08-10 Thread danglin at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49963

John David Anglin danglin at gcc dot gnu.org changed:

   What|Removed |Added

 CC||danglin at gcc dot gnu.org

--- Comment #8 from John David Anglin danglin at gcc dot gnu.org 2011-08-10 
14:13:06 UTC ---
Also occurs on hppa2.0w-hp-hpux11.11.


[Bug tree-optimization/49963] [4.7 Regression] ICE: in abs_hwi, at hwint.c:108

2011-08-08 Thread gjl at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49963

--- Comment #6 from Georg-Johann Lay gjl at gcc dot gnu.org 2011-08-08 
08:28:46 UTC ---
(In reply to comment #5)
 Created attachment 24909 [details]
 Draft patch
 
 I'm attaching a patch which tries to implement what Joseph suggests (thanks!).
 Essentially, I'm replacing all uses of abs_hwi outside hwint.c itself, besides
 three in tree-ssa-math-opts.c which seem correct anyway: the argument is an
 HOST_WIDE_INT / 2 or / 3 and the result is passed to a function taking a plain
 HOST_WIDE_INT. Type-wise the patch makes a lot of sense to me.
 
 Maybe submitter could test it? I'm sanity checking it on x86_64.

That works for me, i.e. gcc.c-torture/execute/divconst-2.c passes with your 
patch.


[Bug tree-optimization/49963] [4.7 Regression] ICE: in abs_hwi, at hwint.c:108

2011-08-03 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49963

Richard Guenther rguenth at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2011.08.03 15:26:26
 CC||paolo.carlini at oracle dot
   ||com, rth at gcc dot
   ||gnu.org, spop at gcc dot
   ||gnu.org
   Target Milestone|--- |4.7.0
Summary|ICE: in abs_hwi, at |[4.7 Regression] ICE: in
   |hwint.c:108 |abs_hwi, at hwint.c:108
 Ever Confirmed|0   |1

--- Comment #1 from Richard Guenther rguenth at gcc dot gnu.org 2011-08-03 
15:26:26 UTC ---
Well - as I said.  Here we go.

Please fix :P


[Bug tree-optimization/49963] [4.7 Regression] ICE: in abs_hwi, at hwint.c:108

2011-08-03 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49963

--- Comment #2 from Richard Guenther rguenth at gcc dot gnu.org 2011-08-03 
15:27:36 UTC ---
Probably fails on any 32bit HWI platform.


[Bug tree-optimization/49963] [4.7 Regression] ICE: in abs_hwi, at hwint.c:108

2011-08-03 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49963

--- Comment #3 from Paolo Carlini paolo.carlini at oracle dot com 2011-08-03 
15:45:06 UTC ---
Eh, my way of fixing it would be removing the assert ;) Seriously, too bad, I
can try to look a bit into it but help is welcome of course, I don't think the
project wants to rely on my judgment about this vs 49914...


[Bug tree-optimization/49963] [4.7 Regression] ICE: in abs_hwi, at hwint.c:108

2011-08-03 Thread joseph at codesourcery dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49963

--- Comment #4 from joseph at codesourcery dot com joseph at codesourcery dot 
com 2011-08-03 18:59:33 UTC ---
I think this is a case for a function absu_hwi or similar that returns an 
unsigned HOST_WIDE_INT value.

(Actually it's a case for operating properly on the INTEGER_CSTs or on 
double_ints without being conditional on whether the values pass 
host_integerp, but that's a more complicated fix.)


[Bug tree-optimization/49963] [4.7 Regression] ICE: in abs_hwi, at hwint.c:108

2011-08-03 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49963

--- Comment #5 from Paolo Carlini paolo.carlini at oracle dot com 2011-08-03 
20:29:51 UTC ---
Created attachment 24909
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=24909
Draft patch

I'm attaching a patch which tries to implement what Joseph suggests (thanks!).
Essentially, I'm replacing all uses of abs_hwi outside hwint.c itself, besides
three in tree-ssa-math-opts.c which seem correct anyway: the argument is an
HOST_WIDE_INT / 2 or / 3 and the result is passed to a function taking a plain
HOST_WIDE_INT. Type-wise the patch makes a lot of sense to me.

Maybe submitter could test it? I'm sanity checking it on x86_64.