This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix overzealous folding
On Thu, May 29, 2008 at 10:58 PM, Richard Guenther
<richard.guenther@gmail.com> wrote:
> On Thu, May 29, 2008 at 10:38 PM, Mark Mitchell <mark@codesourcery.com> wrote:
>> Richard Guenther wrote:
>>
>>> It doesn't make sense. Like it doesn't make sense to test that it is
>>> not a BOOLEAN_TYPE.
>>> But it papers over(?) a problem elsewhere and fixes the wrong-code bug for
>>> Ada.
>>
>> That's what I thought. And, normally, we avoid patches that paper over
>> problems. So, I would ask that Eric figure out where it goes wrong, and
>> then fix the real problem, even if that fix turns out to be "remove use of
>> TYPE_{MIN,MAX}_VALUE" throughout?
>
> I have done that, and I have digged myself. Note that the VRP optimizations
> in question have testcases and ripping it out will provoke more resistance than
> this papering fix.
But note that I'm ok with fixing this properly. The main problem is that it is
written down nowhere what the expected middle-end semantics are for types
with TYPE_MIN/MAX_VALUEs different from what a) their mode, b) their
precision says. It is also under question whether TYPE_MIN/MAX_VALUE of
integer sub-types have any middle-end semantics. See the various re-curring
discussions about this topic.
My plan (if I ever have time to do so) is to after we got
gimplifcation unit-at-a-time
merged, post gimplification go over all referenced types and decls and
"streamline" them for the middle-end. Another evil plan is to un-share all the
folding code. But well, it's all lots of work and I'd rather have
wrong-code bugs
fixed than waiting for a promise for a better future ;)
Richard.