https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107802
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Adam Badura from comment #3) > Why is this marked as a duplicate of bug 98487? I have seen bug 98487 before > reporting it. Furthermore, I experienced it while trying my code sample on > the trunk version to see if the problem still exists. Because the problem is exactly the same. That is with release checking set, the ICE does not happen and instead the attribute gets ignored. > However, since trunk version breaks completely with the same code it is not > possible to determine if the problem reported here exists there or not. > After preventing the compiler from crashing we may very well start to > observe the problem reported here. > > Or is bug 98487 intended to solve the problem reported here as well along > the way? The later. The ICE is due to how attributes are represented internally inside GCC. The scoped attributes are done slightly different from the gnu style attributes but then that was forgotten in the code and only handle the gnu style attribute and that causes an ICE. The fix is to use the functions which handle both ways and it will also fix the ignoring part too. Also if you compile the trunk with --enable-checking=release, you get the behavior reported here of ignoring the attribute; the ignoring is a symptom and the ICE shows the cause (but is hidden in releases for speed reasons).