This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] avoid assuming all integers are representable in HOST_WIDE_INT (PR #80497)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: Martin Sebor <msebor at gmail dot com>, Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 25 Apr 2017 16:29:20 +0200
- Subject: Re: [PATCH] avoid assuming all integers are representable in HOST_WIDE_INT (PR #80497)
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jakub at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 09FC761BB8
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 09FC761BB8
- References: <fcb54c22-615a-a6b0-39b0-aeb15d1001ec@gmail.com> <99c3fe72-974a-7272-20e0-45022891a9a1@redhat.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Apr 25, 2017 at 08:24:32AM -0600, Jeff Law wrote:
> 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.
Ok for 7.1 if you manage to commit before 7.1rc1, otherwise ok for 7.2.
Jakub