public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/106173] New: -fleading-underscore option inactive although reported as active
@ 2022-07-03 12:37 mcn at onet dot pl
  2022-07-03 22:49 ` [Bug middle-end/106173] " pinskia at gcc dot gnu.org
  2022-07-08 12:51 ` marxin at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: mcn at onet dot pl @ 2022-07-03 12:37 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 106173
           Summary: -fleading-underscore option inactive although reported
                    as active
           Product: gcc
           Version: og10 (devel/omp/gcc-10)
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mcn at onet dot pl
  Target Milestone: ---

Compiling a sample C program test.c

#include <stdio.h>

int main()
{
    puts("TEST");
    return 0;
}

with gcc 10.2.1 (on Debian GNU/Linux running on WSL 2) with default options
(gcc test.c) works fine, but adding -fleading-underscore option produces an
error:

gcc -fleading-underscore test.c
/usr/bin/ld:
/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/Scrt1.o: in function
`_start':
(.text+0x20): undefined reference to `main'
/usr/bin/ld: /tmp/cc8SXM3o.o: in function `_main':
test.c:(.text+0xc): undefined reference to `_puts'
collect2: error: ld returned 1 exit status

Interestingly, gcc -Q -V test.c shows -fleading-underscore among enabled
options.

$ gcc -Q -v test.c
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/10/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 10.2.1-6'
--with-bugurl=file:///usr/share/doc/gcc-10/README.Bugs
--enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr
--with-gcc-major-version-only --program-suffix=-10
--program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib
--enable-libphobos-checking=release --with-target-system-zlib=auto
--enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686
--with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib
--with-tune=generic
--enable-offload-targets=nvptx-none=/build/gcc-10-Km9U7s/gcc-10-10.2.1/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-10-Km9U7s/gcc-10-10.2.1/debian/tmp-gcn/usr,hsa
--without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
--with-build-config=bootstrap-lto-lean --enable-link-mutex
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.2.1 20210110 (Debian 10.2.1-6)
COLLECT_GCC_OPTIONS='-Q' '-v' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-linux-gnu/10/cc1 -v -imultiarch x86_64-linux-gnu test.c
-dumpbase test.c -mtune=generic -march=x86-64 -auxbase test -version
-fasynchronous-unwind-tables -o /tmp/ccFkJ2ej.s
GNU C17 (Debian 10.2.1-6) version 10.2.1 20210110 (x86_64-linux-gnu)
        compiled by GNU C version 10.2.1 20210110, GMP version 6.2.1, MPFR
version 4.1.0, MPC version 1.2.0, isl version isl-0.23-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/10/include-fixed"
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-linux-gnu/10/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-linux-gnu/10/include
 /usr/local/include
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
GNU C17 (Debian 10.2.1-6) version 10.2.1 20210110 (x86_64-linux-gnu)
        compiled by GNU C version 10.2.1 20210110, GMP version 6.2.1, MPFR
version 4.1.0, MPC version 1.2.0, isl version isl-0.23-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
options passed:  -v -imultiarch x86_64-linux-gnu test.c -mtune=generic
 -march=x86-64 -fasynchronous-unwind-tables
options enabled:  -fPIC -fPIE -faggressive-loop-optimizations
 -fallocation-dce -fasynchronous-unwind-tables -fauto-inc-dec
 -fdelete-null-pointer-checks -fdwarf2-cfi-asm -fearly-inlining
 -feliminate-unused-debug-symbols -feliminate-unused-debug-types
 -ffp-int-builtin-inexact -ffunction-cse -fgcse-lm -fgnu-unique -fident
 -finline-atomics -fipa-stack-alignment -fira-hoist-pressure
 -fira-share-save-slots -fira-share-spill-slots -fivopts
 -fkeep-static-consts -fleading-underscore -flifetime-dse -fmath-errno
 -fmerge-debug-strings -fpeephole -fplt -fprefetch-loop-arrays
 -freg-struct-return -fsched-critical-path-heuristic
 -fsched-dep-count-heuristic -fsched-group-heuristic -fsched-interblock
 -fsched-last-insn-heuristic -fsched-rank-heuristic -fsched-spec
 -fsched-spec-insn-heuristic -fsched-stalled-insns-dep -fschedule-fusion
 -fsemantic-interposition -fshow-column -fshrink-wrap-separate
 -fsigned-zeros -fsplit-ivs-in-unroller -fssa-backprop -fstdarg-opt
 -fstrict-volatile-bitfields -fsync-libcalls -ftrapping-math -ftree-cselim
 -ftree-forwprop -ftree-loop-if-convert -ftree-loop-im -ftree-loop-ivcanon
 -ftree-loop-optimize -ftree-parallelize-loops= -ftree-phiprop
 -ftree-reassoc -ftree-scev-cprop -funit-at-a-time -funwind-tables
 -fvar-tracking -fvar-tracking-assignments -fzero-initialized-in-bss
 -m128bit-long-double -m64 -m80387 -malign-stringops
 -mavx256-split-unaligned-load -mavx256-split-unaligned-store
 -mfancy-math-387 -mfp-ret-in-387 -mfxsr -mglibc -mieee-fp -mlong-double-80
 -mmmx -mno-sse4 -mpush-args -mred-zone -msse -msse2 -mstv
 -mtls-direct-seg-refs -mvzeroupper
Compiler executable checksum: 1f803793fa2e3418c492b25e7d3eac2f
 main
Analyzing compilation unit
Performing interprocedural optimizations
 <*free_lang_data> {heap 876k} <visibility> {heap 876k} <build_ssa_passes>
{heap 876k} <opt_local_passes> {heap 1068k} <remove_symbols> {heap 1068k}
<targetclone> {heap 1068k} <free-fnsummary> {heap 1068k}Streaming LTO
 <whole-program> {heap 1068k} <hsa> {heap 1068k} <fnsummary> {heap 1068k}
<inline> {heap 1068k} <free-fnsummary> {heap 1068k} <single-use> {heap 1068k}
<comdats> {heap 1068k}Assembling functions:
 <materialize-all-clones> {heap 1068k} <simdclone> {heap 1068k} main
Time variable                                   usr           sys          wall
              GGC
 phase setup                        :   0.00 (  0%)   0.00 (  0%)   0.00 (  0%)
   1240 kB ( 70%)
 phase parsing                      :   0.00 (  0%)   0.01 ( 50%)   0.01 (100%)
    460 kB ( 26%)
 phase opt and generate             :   0.00 (  0%)   0.01 ( 50%)   0.00 (  0%)
     56 kB (  3%)
 preprocessing                      :   0.00 (  0%)   0.01 ( 50%)   0.00 (  0%)
    133 kB (  8%)
 integrated RA                      :   0.00 (  0%)   0.01 ( 50%)   0.00 (  0%)
     24 kB (  1%)
 symout                             :   0.00 (  0%)   0.00 (  0%)   0.01 (100%)
      0 kB (  0%)
 TOTAL                              :   0.00          0.02          0.01       
   1768 kB
COLLECT_GCC_OPTIONS='-Q' '-v' '-mtune=generic' '-march=x86-64'
 as -v --64 -o /tmp/ccrB29rk.o /tmp/ccFkJ2ej.s
GNU assembler version 2.35.2 (x86_64-linux-gnu) using BFD version (GNU Binutils
for Debian) 2.35.2
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/10/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-Q' '-v' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-linux-gnu/10/collect2 -plugin
/usr/lib/gcc/x86_64-linux-gnu/10/liblto_plugin.so
-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/10/lto-wrapper
-plugin-opt=-fresolution=/tmp/ccnNiHdk.res -plugin-opt=-pass-through=-lgcc
-plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id
--eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker
/lib64/ld-linux-x86-64.so.2 -pie
/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/Scrt1.o
/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/crti.o
/usr/lib/gcc/x86_64-linux-gnu/10/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/10
-L/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu
-L/usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib -L/lib/x86_64-linux-gnu
-L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib
-L/usr/lib/gcc/x86_64-linux-gnu/10/../../.. /tmp/ccrB29rk.o -lgcc --push-state
--as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s
--pop-state /usr/lib/gcc/x86_64-linux-gnu/10/crtendS.o
/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/crtn.o
COLLECT_GCC_OPTIONS='-Q' '-v' '-mtune=generic' '-march=x86-64'

To sum up, passing -fleading-underscore option to gcc triggers linking error,
although this option is listed among enabled by default. This seems to be a
bug.

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

* [Bug middle-end/106173] -fleading-underscore option inactive although reported as active
  2022-07-03 12:37 [Bug c/106173] New: -fleading-underscore option inactive although reported as active mcn at onet dot pl
@ 2022-07-03 22:49 ` pinskia at gcc dot gnu.org
  2022-07-08 12:51 ` marxin at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-07-03 22:49 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |12.1.0
      Known to fail|                            |11.1.0

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note in GCC 11+, you need to add --help to get which option has enabled or not.
Also note in GCC 12+ we get:
  -fleading-underscore                  

Which means it is not enabled or disabled. Still trying to figure out what
changed that.

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

* [Bug middle-end/106173] -fleading-underscore option inactive although reported as active
  2022-07-03 12:37 [Bug c/106173] New: -fleading-underscore option inactive although reported as active mcn at onet dot pl
  2022-07-03 22:49 ` [Bug middle-end/106173] " pinskia at gcc dot gnu.org
@ 2022-07-08 12:51 ` marxin at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-07-08 12:51 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
                 CC|                            |marxin at gcc dot gnu.org
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Fixed in r12-5824-g8e836af61b7027c0.

*** This bug has been marked as a duplicate of bug 103438 ***

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

end of thread, other threads:[~2022-07-08 12:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-03 12:37 [Bug c/106173] New: -fleading-underscore option inactive although reported as active mcn at onet dot pl
2022-07-03 22:49 ` [Bug middle-end/106173] " pinskia at gcc dot gnu.org
2022-07-08 12:51 ` marxin 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).