[Bug compile/24653] New: gdb build fails with a recent GCC

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug compile/24653] New: gdb build fails with a recent GCC

adhemerval.zanella at linaro dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=24653

            Bug ID: 24653
           Summary: gdb build fails with a recent GCC
           Product: gdb
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: compile
          Assignee: unassigned at sourceware dot org
          Reporter: marxin.liska at gmail dot com
  Target Milestone: ---

Using a recent GCC snapshot one can see:

g++ -x c++  -g -O2   -I. -I../../gdb -I../../gdb/config
-DLOCALEDIR="\"/home/marxin/bin/binutils/share/locale\"" -DHAVE_CONFIG_H
-I../../gdb/../include/opcode -I../../gdb/../readline/.. -I../../gdb/../zlib
-I../bfd -I../../gdb/../bfd -I../../gdb/../include -I../libdecnumber
-I../../gdb/../libdecnumber  -I../../gdb/gnulib/import -Ibuild-gnulib/import
-DTUI=1    -I/usr/include/python2.7 -I/usr/include/python2.7  -Wall
-Wpointer-arith -Wno-unused -Wunused-value -Wunused-variable -Wunused-function
-Wno-switch -Wno-char-subscripts -Wempty-body -Wunused-but-set-parameter
-Wunused-but-set-variable -Wno-sign-compare -Wno-error=maybe-uninitialized
-Wsuggest-override -Wimplicit-fallthrough=3 -Wduplicated-cond -Wshadow=local
-Wdeprecated-copy -Wdeprecated-copy-dtor -Wredundant-move -Wformat
-Wformat-nonliteral -Werror -c -o regcache.o -MT regcache.o -MMD -MP -MF
./.deps/regcache.Tpo ../../gdb/regcache.c
g++ -x c++  -g -O2   -I. -I../../gdb -I../../gdb/config
-DLOCALEDIR="\"/home/marxin/bin/binutils/share/locale\"" -DHAVE_CONFIG_H
-I../../gdb/../include/opcode -I../../gdb/../readline/.. -I../../gdb/../zlib
-I../bfd -I../../gdb/../bfd -I../../gdb/../include -I../libdecnumber
-I../../gdb/../libdecnumber  -I../../gdb/gnulib/import -Ibuild-gnulib/import
-DTUI=1    -I/usr/include/python2.7 -I/usr/include/python2.7  -Wall
-Wpointer-arith -Wno-unused -Wunused-value -Wunused-variable -Wunused-function
-Wno-switch -Wno-char-subscripts -Wempty-body -Wunused-but-set-parameter
-Wunused-but-set-variable -Wno-sign-compare -Wno-error=maybe-uninitialized
-Wsuggest-override -Wimplicit-fallthrough=3 -Wduplicated-cond -Wshadow=local
-Wdeprecated-copy -Wdeprecated-copy-dtor -Wredundant-move -Wformat
-Wformat-nonliteral -Werror -c -o top.o -MT top.o -MMD -MP -MF ./.deps/top.Tpo
../../gdb/top.c
In file included from ../../gdb/common/common-defs.h:116,
                 from ../../gdb/defs.h:28,
                 from ../../gdb/top.c:20:
../../gdb/top.c: In function ‘void execute_command(const char*, int)’:
../../gdb/../include/libiberty.h:727:36: error: ignoring return value of ‘void*
__builtin_alloca(long unsigned int)’ declared with attribute
‘warn_unused_result’ [-Werror=unused-result]
  727 | # define alloca(x) __builtin_alloca(x)
      |                    ~~~~~~~~~~~~~~~~^~~
../../gdb/top.c:565:3: note: in expansion of macro ‘alloca’
  565 |   alloca (0);
      |   ^~~~~~
In file included from ../../gdb/common/common-defs.h:116,
                 from ../../gdb/defs.h:28,
                 from ../../gdb/regcache.c:20:
../../gdb/regcache.c: In function ‘void registers_changed()’:
../../gdb/../include/libiberty.h:727:36: error: ignoring return value of ‘void*
__builtin_alloca(long unsigned int)’ declared with attribute
‘warn_unused_result’ [-Werror=unused-result]
  727 | # define alloca(x) __builtin_alloca(x)
      |                    ~~~~~~~~~~~~~~~~^~~
../../gdb/regcache.c:463:3: note: in expansion of macro ‘alloca’
  463 |   alloca (0);
      |   ^~~~~~

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug compile/24653] gdb build fails with a recent GCC

adhemerval.zanella at linaro dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=24653

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
Is there any current system requiring the C alloca?
I'm inclined to simply delete these calls.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug compile/24653] gdb build fails with a recent GCC

adhemerval.zanella at linaro dot org
In reply to this post by adhemerval.zanella at linaro dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=24653

--- Comment #2 from Tom Tromey <tromey at sourceware dot org> ---
I sent a patch.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug compile/24653] gdb build fails with a recent GCC

adhemerval.zanella at linaro dot org
In reply to this post by adhemerval.zanella at linaro dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=24653

--- Comment #3 from Martin Liška <marxin.liska at gmail dot com> ---
(In reply to Tom Tromey from comment #2)
> I sent a patch.

Thanks, it looks reasonable to me to remove it.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug compile/24653] gdb build fails with a recent GCC

adhemerval.zanella at linaro dot org
In reply to this post by adhemerval.zanella at linaro dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=24653

--- Comment #4 from Martin Liška <marxin.liska at gmail dot com> ---
Please wait with the patch. We as GCC community are considering not warning for
alloca with argument equal to zero.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug compile/24653] gdb build fails with a recent GCC

adhemerval.zanella at linaro dot org
In reply to this post by adhemerval.zanella at linaro dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=24653

--- Comment #5 from Tom Tromey <tromey at sourceware dot org> ---
(In reply to Martin Liška from comment #4)
> Please wait with the patch. We as GCC community are considering not warning
> for alloca with argument equal to zero.

That would also be fine, but I don't think there's any need for this
code in gdb, regardless of what gcc does.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug compile/24653] gdb build fails with a recent GCC

adhemerval.zanella at linaro dot org
In reply to this post by adhemerval.zanella at linaro dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=24653

--- Comment #6 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom Tromey <[hidden email]>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=abdb711e0855f0597a96db0486b598144b788212

commit abdb711e0855f0597a96db0486b598144b788212
Author: Tom Tromey <[hidden email]>
Date:   Tue Jun 11 06:59:38 2019 -0600

    Remove alloca(0) calls

    PR gdb/24653 points out that a gcc snapshot will complain about the
    calls to alloca(0) in gdb.

    These calls are only needed when using the C alloca.  I'm inclined to
    think that no current platform needs this, so this patch removes the
    calls.

    Let me know what you think.

    gdb/ChangeLog
    2019-06-14  Tom Tromey  <[hidden email]>

        PR gdb/24653:
        * regcache.c (registers_changed): Don't call alloca.
        * top.c (execute_command): Don't call alloca.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug compile/24653] gdb build fails with a recent GCC

adhemerval.zanella at linaro dot org
In reply to this post by adhemerval.zanella at linaro dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=24653

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |9.1

--- Comment #7 from Tom Tromey <tromey at sourceware dot org> ---
Fixed.

--
You are receiving this mail because:
You are on the CC list for the bug.