public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "gcc at pkh dot me" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/95189] New: memcmp being wrongly stripped (regression)
Date: Mon, 18 May 2020 13:56:37 +0000	[thread overview]
Message-ID: <bug-95189-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95189

            Bug ID: 95189
           Summary: memcmp being wrongly stripped (regression)
           Product: gcc
           Version: 10.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gcc at pkh dot me
  Target Milestone: ---

Given the following C code:

    % cat a.c
    #include <string.h>
    static const float z[1] = {0};
    int f(float x) { return memcmp(&x, z, sizeof(x)); }

GCC 10 generates this on x86-64:

    % gcc -Wall -O2 -c a.c && objdump -d -Mintel a.o

    a.o:     file format elf64-x86-64


    Disassembly of section .text:

    0000000000000000 <f>:
       0:       f3 0f 11 44 24 fc       movss  DWORD PTR [rsp-0x4],xmm0
       6:       0f b6 44 24 fc          movzx  eax,BYTE PTR [rsp-0x4]
       b:       c3                      ret

This doesn't happen if "= {0}" is removed from the z initialization (wtf?).
It also doesn't happen with -O1.

             reply	other threads:[~2020-05-18 13:56 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-18 13:56 gcc at pkh dot me [this message]
2020-05-19  6:28 ` [Bug middle-end/95189] [10/11 Regression] memcmp being wrongly stripped like strcmp rguenth at gcc dot gnu.org
2020-05-23 21:01 ` jakub at gcc dot gnu.org
2020-05-23 21:17 ` jakub at gcc dot gnu.org
2020-05-24 20:10 ` msebor at gcc dot gnu.org
2020-06-09 13:38 ` gcc at pkh dot me
2020-06-09 23:53 ` msebor at gcc dot gnu.org
2020-06-24 21:24 ` msebor at gcc dot gnu.org
2020-07-01  0:25 ` msebor at gcc dot gnu.org
2020-07-01 14:46 ` msebor at gcc dot gnu.org
2020-07-13 15:50 ` jerryfromearth at gmail dot com
2020-07-20 18:09 ` cvs-commit at gcc dot gnu.org
2020-07-20 18:10 ` [Bug middle-end/95189] [10 " msebor at gcc dot gnu.org
2020-07-23  6:51 ` rguenth at gcc dot gnu.org
2020-08-16 20:26 ` [Bug middle-end/95189] [9/10 " pinskia at gcc dot gnu.org
2020-08-16 20:26 ` pinskia at gcc dot gnu.org
2020-09-03 22:37 ` amonakov at gcc dot gnu.org
2020-09-06 23:28 ` msebor at gcc dot gnu.org
2020-09-27 14:22 ` public at timruffing dot de
2020-10-05 23:41 ` luke-jr+gccbugs at utopios dot org
2020-10-06  5:47 ` amonakov at gcc dot gnu.org
2020-10-07 22:49 ` bugdal at aerifal dot cx
2020-10-08  4:31 ` luke-jr+gccbugs at utopios dot org
2020-10-08 18:38 ` cvs-commit at gcc dot gnu.org
2020-10-08 18:40 ` msebor at gcc dot gnu.org
2020-10-08 22:51 ` bugdal at aerifal dot cx
2020-10-09  0:12 ` luke-jr+gccbugs at utopios dot org
2020-10-09  2:26 ` bugdal at aerifal dot cx
2020-10-09 13:09 ` luke-jr+gccbugs at utopios dot org
2021-01-02  5:05 ` davmac at davmac dot org
2021-06-01  8:17 ` rguenth at gcc dot gnu.org
2021-06-24  1:13 ` bugdal at aerifal dot cx
2021-06-24  6:29 ` [Bug middle-end/95189] [9 " rguenth at gcc dot gnu.org
2022-03-17 19:47 ` msebor at gcc dot gnu.org
2022-05-27  8:54 ` rguenth at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-95189-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).