From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27641 invoked by alias); 12 Jan 2015 10:05:08 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 27362 invoked by uid 48); 12 Jan 2015 10:05:00 -0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/64554] using _mm_clmulepi64_si128 doesn't error with -O0 Date: Mon, 12 Jan 2015 10:05:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 4.9.1 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-01/txt/msg00767.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D64554 --- Comment #7 from Jakub Jelinek --- (In reply to Richard Biener from comment #6) > (In reply to charles from comment #5) > > No you're right. > >=20 > > I could add, though, that the compiler should have said something. > >=20 > > Also, why did it compile just fine with -O0? >=20 > Sounds like a bug (we should error immediately here IMHO). Probably > needs to annotate the CIF codes with whether this is "fatal" (won't > change with other inlining, IPA or LTO). >=20 > OTOH the headers are also poorly designed to trigger this kind of error. >=20 > Maybe we want to support __attribute__((always_inline("ISA not enabled"))) > instead to be able to print a custom error message? The difference is that for __OPTIMIZE__ _mm_clmulepi64_si128 is implement= ed as always_inline function (surrounded by #pragma GCC target("pclmul")), so = for -O1+ the inlining error is expected, such function can't be inlined into the current function, and always_inline mandates that it is inlined (without always_inline it would simply not be inlined, and the out of line _mm_clmulepi64_si128 would use the pclmul ISA, while the caller would not). For -O0, this is implemented using a macro, since the last argument must be= a constant, and the reason you get no error is that the function is const and= you don't use the result, so it is DCEd. If you actually use the result (at -O0 it is enough to store it into say __m128i c =3D _mm_clmulepi64_si128(a, b, 1); , for -O1 you'd need something better, store into volatile var, or global var or otherwise make sure it is= n't DCEd), then you get this diagnosed: /tmp/z.c: In function =E2=80=98main=E2=80=99: /tmp/z.c:6:11: error: =E2=80=98__builtin_ia32_pclmulqdq128=E2=80=99 needs i= sa option -m32 -mpclmul __m128i c =3D _mm_clmulepi64_si128(a, b, 1); ^ So I don't see any bug on the gcc side here. >>From gcc-bugs-return-472775-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Jan 12 10:10:57 2015 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 7619 invoked by alias); 12 Jan 2015 10:10:56 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 7526 invoked by uid 48); 12 Jan 2015 10:10:51 -0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/64535] Emergency buffer for exception allocation too small Date: Mon, 12 Jan 2015 10:10:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-01/txt/msg00769.txt.bz2 Content-length: 350 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64535 --- Comment #9 from Jakub Jelinek --- If all allocations from the emergency pool are at least sizeof(__cxa_refcounted_exception) long (or what is the minimum), then trying to split the memory into smaller chunks (down to sizeof(free_entry)) might be counter-productive.