This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch for PR 37418
On Sun, Sep 14, 2008 at 7:06 PM, Joseph S. Myers
<joseph@codesourcery.com> wrote:
> On Sun, 14 Sep 2008, Richard Guenther wrote:
>
>> Thanks for the detailed analysis. Indeed while designing the type-system
>> (as of tree-ssa.c:useless_type_conversion_p) I didn't think of "abuses" of
>> qualifiers. As of the fix - would the following (IMHO cleaner - the validity
>> checks are used elsewhere as well) work as well?
>
> Yes, treating such conversions as useless should work for this bug (if it
> passes the four testcases it's probably working). Though as the
> conversions do have semantics (a call through a noreturn pointer, or to a
> function originally declared noreturn, can't return; a call through a
> non-noreturn pointer can return, presuming the function wasn't actually
> declared noreturn even if it's been cast to noreturn and back) there may
> be risks to treating them as useless - though I expect such conversions
> don't work reliably at present anyway.
Right. But I guess it is at the discretion of the frontend to
eventually disallow
such conversions.
IMHO treating the conversions as useless for now is the better solution (and
in the end not different from allowing them in the verifier only).
Thanks,
Richard.