This is the mail archive of the
mailing list for the GCC project.
Re: missed optimization
- From: fxcoudert at gmail dot com
- To: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- Cc: fortran at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- Date: Tue, 29 Sep 2015 21:27:13 +0200
- Subject: Re: missed optimization
- Authentication-results: sourceware.org; auth=none
- References: <20150929183645 dot GA86538 at troutmask dot apl dot washington dot edu>
It cannot be done in the front-end, but has to happen during value propagation in the middle-end. But the middle-end only handles known *_EXPR and built-ins. So this would require adding either a POWINT_EXPR or a type-generic __builtin_powint. No small task.
I think there is already a PR for that (at the very least, I have looked into it and discussed it with some middle-end experts before). I cannot look it up right now, it's the interlude of Don Govanni at Paris Opera :)