public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/110073] New: [14 regression] btfout.cc format errors break bootstrap
@ 2023-06-01 10:05 ro at gcc dot gnu.org
  2023-06-01 10:05 ` [Bug debug/110073] " ro at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: ro at gcc dot gnu.org @ 2023-06-01 10:05 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110073
           Summary: [14 regression] btfout.cc format errors break
                    bootstrap
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: build
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ro at gcc dot gnu.org
                CC: david.faust at oracle dot com
  Target Milestone: ---
            Target: i386-pc-solaris2.11

Created attachment 55230
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55230&action=edit
proposed patch

This patch

commit 7aae58b04b92303ccda3ead600be98f0d4b7f462
Author: David Faust <david.faust@oracle.com>
Date:   Wed May 31 08:31:24 2023 -0700

    btf: improve -dA comments for testsuite

broke (at least) Solaris/x86 bootstrap:

/vol/gcc/src/hg/master/local/gcc/btfout.cc: In function 'void
btf_asm_type(ctf_container_ref, ctf_dtdef_ref)':
/vol/gcc/src/hg/master/local/gcc/btfout.cc:802:32: error: format '%lu' expects
argument of type 'long unsigned int', but argument 4 has type 'ctf_id_t' {aka
'long long unsigned int'} [-Werror=format=]
  802 |                        "TYPE %lu BTF_KIND_%s '%s'",
      |                              ~~^
      |                                |
      |                                long unsigned int
      |                              %llu
  803 |                        get_btf_id (dtd->dtd_type), btf_kind_name
(btf_kind),
      |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                   |
      |                                   ctf_id_t {aka long long unsigned int}

ctf_id_t is uint64_t, from gcc/ctfc.h; should use PRIu64 instead

/vol/gcc/src/hg/master/local/gcc/btfout.cc: In function 'void
btf_asm_func_type(ctf_container_ref, ctf_dtdef_ref, std::size_t)':
/vol/gcc/src/hg/master/local/gcc/btfout.cc:944:32: error: format '%lu' expects
argument of type 'long unsigned int', but argument 4 has type 'unsigned int'
[-Werror=format=]
  944 |                        "TYPE %lu BTF_KIND_FUNC '%s'",
      |                              ~~^
      |                                |
     |                              ~~^
      |                                |
      |                                long unsigned int
      |                              %u
  945 |                        num_types_added + num_vars_added + 1 + i,
      |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                             |
      |                                                             unsigned
int

just use %u instead

The attached patch allowed the build to succeed; make check still running.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug debug/110073] [14 regression] btfout.cc format errors break bootstrap
  2023-06-01 10:05 [Bug debug/110073] New: [14 regression] btfout.cc format errors break bootstrap ro at gcc dot gnu.org
@ 2023-06-01 10:05 ` ro at gcc dot gnu.org
  2023-06-01 16:50 ` david.faust at oracle dot com
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ro at gcc dot gnu.org @ 2023-06-01 10:05 UTC (permalink / raw)
  To: gcc-bugs

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

Rainer Orth <ro at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.0

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug debug/110073] [14 regression] btfout.cc format errors break bootstrap
  2023-06-01 10:05 [Bug debug/110073] New: [14 regression] btfout.cc format errors break bootstrap ro at gcc dot gnu.org
  2023-06-01 10:05 ` [Bug debug/110073] " ro at gcc dot gnu.org
@ 2023-06-01 16:50 ` david.faust at oracle dot com
  2023-06-02  8:38 ` iains at gcc dot gnu.org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: david.faust at oracle dot com @ 2023-06-01 16:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from David Faust <david.faust at oracle dot com> ---
Created attachment 55234
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55234&action=edit
alternate proposed patch

Thank you for catching this, and for the fix!

With the proposed patch on linux x86_64 I see the following:

../../../gcc/gcc/btfout.cc: In function ‘void
btf_asm_func_type(ctf_container_ref, ctf_dtdef_ref, size_t)’:
../../../gcc/gcc/btfout.cc:952:31: warning: format ‘%u’ expects argument of
type ‘unsigned int’, but argument 4 has type ‘size_t’ {aka ‘long unsigned int’}
[-Wformat=]
  952 |                        "TYPE %u BTF_KIND_FUNC '%s'",
      |                              ~^
      |                               |
      |                               unsigned int
      |                              %lu
  953 |                        num_types_added + num_vars_added + 1 + i,
      |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                             |
      |                                                             size_t {aka
long unsigned int}

I believe %zu instead of %u should work.

Alternatively, a small refactor to the offending code makes it behave in line
with the other functions (to properly use a ctf_id_t, and then PRIu64 as in
your patch). But I haven't verified this on solaris/x86 yet.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug debug/110073] [14 regression] btfout.cc format errors break bootstrap
  2023-06-01 10:05 [Bug debug/110073] New: [14 regression] btfout.cc format errors break bootstrap ro at gcc dot gnu.org
  2023-06-01 10:05 ` [Bug debug/110073] " ro at gcc dot gnu.org
  2023-06-01 16:50 ` david.faust at oracle dot com
@ 2023-06-02  8:38 ` iains at gcc dot gnu.org
  2023-06-02 12:58 ` iains at gcc dot gnu.org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: iains at gcc dot gnu.org @ 2023-06-02  8:38 UTC (permalink / raw)
  To: gcc-bugs

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

Iain Sandoe <iains at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2023-06-02
     Ever confirmed|0                           |1
                 CC|                            |iains at gcc dot gnu.org
             Target|i386-pc-solaris2.11         |i386-pc-solaris2.11,
                   |                            |x86_64-apple-darwin*
             Status|UNCONFIRMED                 |NEW

--- Comment #2 from Iain Sandoe <iains at gcc dot gnu.org> ---
there seems to be a second fail on x86_64 darwin on line 970.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug debug/110073] [14 regression] btfout.cc format errors break bootstrap
  2023-06-01 10:05 [Bug debug/110073] New: [14 regression] btfout.cc format errors break bootstrap ro at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-06-02  8:38 ` iains at gcc dot gnu.org
@ 2023-06-02 12:58 ` iains at gcc dot gnu.org
  2023-06-02 15:49 ` david.faust at oracle dot com
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: iains at gcc dot gnu.org @ 2023-06-02 12:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Iain Sandoe from comment #2)
> there seems to be a second fail on x86_64 darwin on line 970.

I tried the alternate patch on a number of x86_64, i686 and power Darwin
systems and bootstrap is restored.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug debug/110073] [14 regression] btfout.cc format errors break bootstrap
  2023-06-01 10:05 [Bug debug/110073] New: [14 regression] btfout.cc format errors break bootstrap ro at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2023-06-02 12:58 ` iains at gcc dot gnu.org
@ 2023-06-02 15:49 ` david.faust at oracle dot com
  2023-06-02 16:24 ` iains at gcc dot gnu.org
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: david.faust at oracle dot com @ 2023-06-02 15:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from David Faust <david.faust at oracle dot com> ---
(In reply to Iain Sandoe from comment #3)
> (In reply to Iain Sandoe from comment #2)
> > there seems to be a second fail on x86_64 darwin on line 970.
> 
> I tried the alternate patch on a number of x86_64, i686 and power Darwin
> systems and bootstrap is restored.

Thanks for confirming. I'll go ahead and send it to the list.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug debug/110073] [14 regression] btfout.cc format errors break bootstrap
  2023-06-01 10:05 [Bug debug/110073] New: [14 regression] btfout.cc format errors break bootstrap ro at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2023-06-02 15:49 ` david.faust at oracle dot com
@ 2023-06-02 16:24 ` iains at gcc dot gnu.org
  2023-06-02 16:32 ` david.faust at oracle dot com
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: iains at gcc dot gnu.org @ 2023-06-02 16:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to David Faust from comment #4)
> (In reply to Iain Sandoe from comment #3)
> > (In reply to Iain Sandoe from comment #2)
> > > there seems to be a second fail on x86_64 darwin on line 970.
> > 
> > I tried the alternate patch on a number of x86_64, i686 and power Darwin
> > systems and bootstrap is restored.
> 
> Thanks for confirming. I'll go ahead and send it to the list.

I think with bootstrap fixes, you are allowed a bit more independence - i.e.
can go ahead and apply - but now needs resolution with Alex's patch,

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug debug/110073] [14 regression] btfout.cc format errors break bootstrap
  2023-06-01 10:05 [Bug debug/110073] New: [14 regression] btfout.cc format errors break bootstrap ro at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2023-06-02 16:24 ` iains at gcc dot gnu.org
@ 2023-06-02 16:32 ` david.faust at oracle dot com
  2023-06-02 16:33 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: david.faust at oracle dot com @ 2023-06-02 16:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from David Faust <david.faust at oracle dot com> ---
(In reply to Iain Sandoe from comment #5)
> (In reply to David Faust from comment #4)
> > (In reply to Iain Sandoe from comment #3)
> > > (In reply to Iain Sandoe from comment #2)
> > > > there seems to be a second fail on x86_64 darwin on line 970.
> > > 
> > > I tried the alternate patch on a number of x86_64, i686 and power Darwin
> > > systems and bootstrap is restored.
> > 
> > Thanks for confirming. I'll go ahead and send it to the list.
> 
> I think with bootstrap fixes, you are allowed a bit more independence - i.e.
> can go ahead and apply - but now needs resolution with Alex's patch,

OK, thanks. And yes I just ran into the conflict. Rebasing now.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug debug/110073] [14 regression] btfout.cc format errors break bootstrap
  2023-06-01 10:05 [Bug debug/110073] New: [14 regression] btfout.cc format errors break bootstrap ro at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2023-06-02 16:32 ` david.faust at oracle dot com
@ 2023-06-02 16:33 ` cvs-commit at gcc dot gnu.org
  2023-06-02 16:35 ` acoplan at gcc dot gnu.org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-06-02 16:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by David Faust <dfaust@gcc.gnu.org>:

https://gcc.gnu.org/g:934da923a7295ae97e37425e269195c7d8770ef0

commit r14-1504-g934da923a7295ae97e37425e269195c7d8770ef0
Author: David Faust <david.faust@oracle.com>
Date:   Fri Jun 2 09:28:32 2023 -0700

    btf: fix bootstrap -Wformat errors [PR110073]

    Commit 7aae58b04b9 "btf: improve -dA comments for testsuite" broke
    bootstrap on a number of architectures because it introduced some
    new -Wformat errors.

    Fix those errors by properly using PRIu64 and a small refactor to
    the offending code.

    Based on the suggested patch from Rainer Orth.

            PR debug/110073

    gcc/ChangeLog:

            * btfout.cc (btf_absolute_func_id): New function.
            (btf_asm_func_type): Call it here.  Change index parameter from
            size_t to ctf_id_t.  Use PRIu64 formatter.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug debug/110073] [14 regression] btfout.cc format errors break bootstrap
  2023-06-01 10:05 [Bug debug/110073] New: [14 regression] btfout.cc format errors break bootstrap ro at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2023-06-02 16:33 ` cvs-commit at gcc dot gnu.org
@ 2023-06-02 16:35 ` acoplan at gcc dot gnu.org
  2023-06-02 16:41 ` david.faust at oracle dot com
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: acoplan at gcc dot gnu.org @ 2023-06-02 16:35 UTC (permalink / raw)
  To: gcc-bugs

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

Alex Coplan <acoplan at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |acoplan at gcc dot gnu.org

--- Comment #8 from Alex Coplan <acoplan at gcc dot gnu.org> ---
Thanks for the follow-up fix and apologies for the mid-air collision, I didn't
see the %zu problem on the target I was testing.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug debug/110073] [14 regression] btfout.cc format errors break bootstrap
  2023-06-01 10:05 [Bug debug/110073] New: [14 regression] btfout.cc format errors break bootstrap ro at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2023-06-02 16:35 ` acoplan at gcc dot gnu.org
@ 2023-06-02 16:41 ` david.faust at oracle dot com
  2023-06-29  8:00 ` iains at gcc dot gnu.org
  2023-06-29  8:47 ` ro at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: david.faust at oracle dot com @ 2023-06-02 16:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from David Faust <david.faust at oracle dot com> ---
(In reply to Alex Coplan from comment #8)
> Thanks for the follow-up fix and apologies for the mid-air collision, I
> didn't see the %zu problem on the target I was testing.

No problem, thanks for the fixes :) I'm slow on the patch formatting etc.
Hopefully these are all taken care of now between the two patches.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug debug/110073] [14 regression] btfout.cc format errors break bootstrap
  2023-06-01 10:05 [Bug debug/110073] New: [14 regression] btfout.cc format errors break bootstrap ro at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2023-06-02 16:41 ` david.faust at oracle dot com
@ 2023-06-29  8:00 ` iains at gcc dot gnu.org
  2023-06-29  8:47 ` ro at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: iains at gcc dot gnu.org @ 2023-06-29  8:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Iain Sandoe <iains at gcc dot gnu.org> ---
this is fixed, at least on Darwin, right?
is there some failing case remaining on Solaris or can we close this?

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug debug/110073] [14 regression] btfout.cc format errors break bootstrap
  2023-06-01 10:05 [Bug debug/110073] New: [14 regression] btfout.cc format errors break bootstrap ro at gcc dot gnu.org
                   ` (10 preceding siblings ...)
  2023-06-29  8:00 ` iains at gcc dot gnu.org
@ 2023-06-29  8:47 ` ro at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: ro at gcc dot gnu.org @ 2023-06-29  8:47 UTC (permalink / raw)
  To: gcc-bugs

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

Rainer Orth <ro at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #11 from Rainer Orth <ro at gcc dot gnu.org> ---
Solaris is fine, so I think we're good.

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-06-29  8:47 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-01 10:05 [Bug debug/110073] New: [14 regression] btfout.cc format errors break bootstrap ro at gcc dot gnu.org
2023-06-01 10:05 ` [Bug debug/110073] " ro at gcc dot gnu.org
2023-06-01 16:50 ` david.faust at oracle dot com
2023-06-02  8:38 ` iains at gcc dot gnu.org
2023-06-02 12:58 ` iains at gcc dot gnu.org
2023-06-02 15:49 ` david.faust at oracle dot com
2023-06-02 16:24 ` iains at gcc dot gnu.org
2023-06-02 16:32 ` david.faust at oracle dot com
2023-06-02 16:33 ` cvs-commit at gcc dot gnu.org
2023-06-02 16:35 ` acoplan at gcc dot gnu.org
2023-06-02 16:41 ` david.faust at oracle dot com
2023-06-29  8:00 ` iains at gcc dot gnu.org
2023-06-29  8:47 ` ro at gcc dot gnu.org

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).