[Bug other/46677] frontends and tree optimizers use *_TYPE_SIZE

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Nov 26 22:57:00 GMT 2010


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46677

--- Comment #6 from Richard Guenther <rguenth at gcc dot gnu.org> 2010-11-26 22:18:23 UTC ---
(In reply to comment #5)
> (In reply to comment #3)
> > * Modifiable members of targetm are a bad idea and make LTO-based 
> > devirtualization harder (I'd rather targetm was const for single-target 
> > builds), and these values depend on command-line options so function 
> > members are more appropriate.
> 
> But if these members are only ever assigned a single constant, wouldn't
> LTO be able to figure this out?

No.  The optimization passes that are remotely related do not work
flow or context sensitive, so we don't know whether the initialization
takes place unless it is a static initializer.

> > * All the macros relating to the sizes of various C types in bits should 
> > be replaced by hooks that are only called to create the associated tree 
> > nodes; elsewhere they should be replaced by TYPE_PRECISION 
> > (integer_type_node) etc.
> 
> You are not making this easier for LTO to optimize this back to a constant.

True.  LTO won't be able to figure out TYPE_PRECISION (char_type_node).



More information about the Gcc-bugs mailing list