public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jsm28 at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/112358] New: [14 Regression] glibc -Wstringop-overflow= build failure
Date: Thu, 02 Nov 2023 23:25:20 +0000	[thread overview]
Message-ID: <bug-112358-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 112358
           Summary: [14 Regression] glibc -Wstringop-overflow= build
                    failure
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jsm28 at gcc dot gnu.org
                CC: rguenth at gcc dot gnu.org
  Target Milestone: ---
            Target: hppa-linux-gnu

Created attachment 56497
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56497&action=edit
preprocessed source

Building glibc for hppa-linux-gnu has been failing since 18 September:

In file included from ../include/atomic.h:49,
                 from dl-find_object.c:20:
In function '_dlfo_update_init_seg',
    inlined from '_dl_find_object_update_1' at dl-find_object.c:689:30,
    inlined from '_dl_find_object_update' at dl-find_object.c:805:13:
../sysdeps/unix/sysv/linux/hppa/atomic-machine.h:44:4: error:
'__atomic_store_4' writing 4 bytes into a region of size 0 overflows the
destination [-Werror=stringop-overflow=]
   44 |    __atomic_store_n ((mem), (val), __ATOMIC_RELAXED);                  
     \
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dl-find_object.c:644:3: note: in expansion of macro 'atomic_store_relaxed'
  644 |   atomic_store_relaxed (&seg->size, new_seg_size);
      |   ^~~~~~~~~~~~~~~~~~~~
In function '_dl_find_object_update':
cc1: note: destination object is likely at address zero

Compile the attached test with -O2 -Wall:

In function '_dlfo_update_init_seg',
    inlined from '_dl_find_object_update_1' at dl-find_object.c:689:30,
    inlined from '_dl_find_object_update' at dl-find_object.c:805:12:
dl-find_object.c:644:132: warning: '__atomic_store_4' writing 4 bytes into a
region of size 0 overflows the destination [-Wstringop-overflow=]
In function '_dl_find_object_update':
cc1: note: destination object is likely at address zero

I don't know why the compiler thinks "destination object is likely at address
zero", so maybe there is actually an issue in the glibc sources, but I didn't
see an obvious reason for the warning/error.

Introduced by the commit:

commit d45ddc2c04e471d0dcee016b6edacc00b8341b16
Author:     Richard Biener <rguenther@suse.de>
AuthorDate: Thu Sep 14 13:06:51 2023 +0200
Commit:     Richard Biener <rguenther@suse.de>
CommitDate: Mon Sep 18 10:56:18 2023 +0200

    tree-optimization/111294 - backwards threader PHI costing

             reply	other threads:[~2023-11-02 23:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-02 23:25 jsm28 at gcc dot gnu.org [this message]
2023-11-03  8:04 ` [Bug tree-optimization/112358] " rguenth at gcc dot gnu.org
2024-03-07 21:03 ` law at gcc dot gnu.org
2024-05-07  7:42 ` [Bug tree-optimization/112358] [14/15 " 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-112358-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).