This is the mail archive of the gcc-help@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]

Union an alias when the difference is the volatile qualifier?


According to -fno-strict-aliasing in the online manual
(https://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html):

    Allow the compiler to assume the strictest aliasing rules ...
    ... unless the types are almost the same.

I think "almost the same" applies to sizes and alignments, and not
qualifiers like const and volatile.

Does GCC consider an 'int' and a 'volatile int' (or 'int*' and a
'volatile int*') almost the same?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]