This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: BUG: assuming signed overflow does not occur when simplifying conditional to constant
- From: Bruce Korb <bruce dot korb at gmail dot com>
- To: Florian Weimer <fw at deneb dot enyo dot de>
- Cc: GCC <gcc at gcc dot gnu dot org>
- Date: Sat, 29 Dec 2012 10:45:12 -0800
- Subject: Re: BUG: assuming signed overflow does not occur when simplifying conditional to constant
- References: <50DE3564.2020905@gmail.com> <874nj5m9cj.fsf@mid.deneb.enyo.de>
Hi Florian,
On Sat, Dec 29, 2012 at 2:38 AM, Florian Weimer <fw@deneb.enyo.de> wrote:
>> ../../autoopts/configfile.c: In function 'intern_file_load':
>> ../../autoopts/configfile.c:1025:12: error: assuming signed overflow does not occur \
>> when simplifying conditional to constant [-Werror=strict-overflow]
>
> I can't reproduce this. Can you post a minimal example that actually
> shows this warning?
Not easily. git clone git://git.savannah.gnu.org/autogen.git
I'd have to prune code until I can't prune more. Unfortunately,
I don't have that kind of time. I do wish I did.....
>> My guess is that some code somewhere presumes that "idx" never gets
>> decremented. Not true.
>
> The warning can trigger after inlining and constant propogation,
> somewhat obscuring its cause. PR55616 is one such example.
It was clear it was some sort of optimization triggered issue.
I'd guess that since the program would not function if the condition
expression were optimized into a constant, then, therefore, the
warning trigger was faulty. The message itself was also obtuse.
Thank you for taking the time to think over the issue.
Regards, Bruce