[PATCH] avoid assuming all integers are representable in HOST_WIDE_INT (PR #80497)

Jeff Law law@redhat.com
Tue Apr 25 14:39:00 GMT 2017


On 04/24/2017 05:35 PM, Martin Sebor wrote:
> Bug 80497 brings to light that my fix for PR 80364 where I corrected
> the handling for int128_t was incomplete.  I handled the non-constant
> case but missed the INTEGER_CST case just a few lines above.  The
> attached patch also corrects that problem plus one more elsewhere
> in the pass.
> 
> Both of the changes in this patch seem safe enough to make even now
> in GCC 7 but since they are ice-on-invalid-code perhaps it's better
> to wait for 7.1?
> 
> Martin
> 
> gcc-80497.diff
> 
> 
> PR tree-optimization/80497 - ICE at -O1 and above on valid code on x86_64-linux-gnu in tree_to_uhwi
> 
> gcc/ChangeLog:
> 
> 	PR tree-optimization/80497
> 	* gimple-ssa-sprintf.c (get_int_range): Avoid assuming all integer
> 	constants are representable in HOST_WIDE_INT.
> 	(parse_directive): Ditto.
> 
> gcc/testsuite/ChangeLog:
> 
> 	PR tree-optimization/80497
> 	* gcc.dg/tree-ssa/builtin-sprintf-warn-17.c: New test.
OK for the trunk.  Jakub's call on when it's OK for the branch -- one 
can easily argue this is a regression.

jeff



More information about the Gcc-patches mailing list