This is the mail archive of the
`gcc-patches@gcc.gnu.org`
mailing list for the GCC project.

Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|

Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |

Other format: | [Raw text] |

*From*: Michael Matz <matz at suse dot de>*To*: Richard Kenner <kenner at vlsi1 dot ultra dot nyu dot edu>*Cc*: iant at google dot com, ebotcazou at adacore dot com, gcc-patches at gcc dot gnu dot org, richard dot guenther at gmail dot com*Date*: Tue, 2 Oct 2007 15:58:30 +0200 (CEST)*Subject*: Re: [PATCH] Fix optimization regression in constant folder*References*: <200709171539.26653.ebotcazou@adacore.com> <200710010127.59677.ebotcazou@adacore.com> <m3abr33dbp.fsf@localhost.localdomain> <10710010056.AA15609@vlsi1.ultra.nyu.edu> <Pine.LNX.4.64.0710010325340.23011@wotan.suse.de> <10710010257.AA21585@vlsi1.ultra.nyu.edu> <Pine.LNX.4.64.0710010454060.23011@wotan.suse.de> <10710010344.AA22633@vlsi1.ultra.nyu.edu> <84fc9c000710010212q3c28f27do3c665c87c6089bc9@mail.gmail.com> <10710011233.AA10135@vlsi1.ultra.nyu.edu> <84fc9c000710010540o7d648f21q4fd19df493629b26@mail.gmail.com> <10710011319.AA12088@vlsi1.ultra.nyu.edu> <m3ve9q207p.fsf@localhost.localdomain> <10710011934.AA24578@vlsi1.ultra.nyu.edu> <m3abr21uou.fsf@localhost.localdomain> <10710012032.AA26765@vlsi1.ultra.nyu.edu>

Hi, On Mon, 1 Oct 2007, Richard Kenner wrote: > I'm not trying to figure out a way to make things work now, but to establish > a framework for the future. The semantics of sizetypes mean "don't > suppress *any* optimizations". Let me show you why the predicate "don't suppress any optimizations" is non-sensical by a constructed example: Suppose we were to introduce a type flag which can be applied to integral types ensuring that all values of that type are even integers, TYPE_EVEN_VALUED. Presumably we did so because we saw the need for some worthwhile transformation applied to such values. For instance we could use the low bit for something else, or increase the range of that type to be twice the nominal range. Let one of these transformations be an optimization. You are probably not going to argue that such optimization should also be applied to your sizetype. Hence "all" optimizations is a useless predicate. You need to spell out what operations are allowed on that type, and what the invariants for them are. There really is no way around this. Because otherwise someone somewhere will break what you think the semantics of it should be, but neglected to specify. So, there's your path to the future, ensuring nobody will break your wishes; spell out what operations are required for your type. To make that easy start with the most similar existing type (probably signed integer), and say what the new invariants of operations are. Then destill those invariants (or better the diff to the invariants from the starting type) to a small set of orthogonal properties which can then be flags on types (and perhaps that will simply lead to only the IGNORE_OVERFLOW from Ian). TYPE_IS_SIZETYPE is not such element of an orthogonal set of properties. Ciao, Michael.

**References**:**Re: [PATCH] Fix optimization regression in constant folder***From:*Ian Lance Taylor

**Re: [PATCH] Fix optimization regression in constant folder***From:*Richard Kenner

**Re: [PATCH] Fix optimization regression in constant folder***From:*Michael Matz

**Re: [PATCH] Fix optimization regression in constant folder***From:*Richard Kenner

**Re: [PATCH] Fix optimization regression in constant folder***From:*Michael Matz

**Re: [PATCH] Fix optimization regression in constant folder***From:*Richard Kenner

**Re: [PATCH] Fix optimization regression in constant folder***From:*Richard Guenther

**Re: [PATCH] Fix optimization regression in constant folder***From:*Richard Kenner

**Re: [PATCH] Fix optimization regression in constant folder***From:*Richard Guenther

**Re: [PATCH] Fix optimization regression in constant folder***From:*Richard Kenner

**Re: [PATCH] Fix optimization regression in constant folder***From:*Ian Lance Taylor

**Re: [PATCH] Fix optimization regression in constant folder***From:*Richard Kenner

**Re: [PATCH] Fix optimization regression in constant folder***From:*Ian Lance Taylor

**Re: [PATCH] Fix optimization regression in constant folder***From:*Richard Kenner

Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|

Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |