https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60875
--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> --- There are different kinds of pragmas, pragmas that are just noted during preprocessing and indeed disappear in phase 4, and then there are pragmas which actually result in pragma declarations/statements/expressions being parsed (in GCC these are called deferred pragmas). What you said applies to the former kind of pragma, not the latter. Where exactly in the IL the latter can appear depends on the kind of pragma, they can't appear anywhere. Examples are e.g. the OpenMP pragmas (OpenMP specifies exactly where they can appear, some are just before declarations, others like statements, others similarly but with rules that they can't appear e.g. as the substatement of if, while, do, for etc., others can only appear before for statements. GCC ivdep/unroll/novect pragmas also can only appear before for statements. ANd GCC diagnostic I think acts as a statement.