[Bug other/35014] Libgfortran.a (downloaded) is not PIC compiled...

2024-03-16 Thread iains at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=35014

Iain Sandoe  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|WONTFIX |---

--- Comment #15 from Iain Sandoe  ---
(In reply to Amir Shahmoradi from comment #14)
> It's not a bug but a popular requested feature. See, for example, the
> discussion here:
> https://fortran-lang.discourse.group/t/distribute-shared-libraries-or-not/
> 7532/1

OK - I will reopen - but really someone needs to propose a patch - otherwise
releases just go by.

> Are there any downsides to distributing PIC-enabled `libgfortran.a` on all
> platforms?

yes. For platforms that support non-pic user-space code (e.g. Linux) then this
would produce a performance penalty (since the PIC code is typically slower)

> For consistency, if this is the default behavior on macOS, it should be the
> default on all platforms.

I doubt that would be a general agreement.

If a given distribution (or use-case) needs the PIC version [and I can totally
see why that would be the case for embedding it in a plugin) - then perhaps a
suitable solution would be to introduce a specific configuration flag like
"--enable-pic-runtimes" or "--enable-pic-libgfortran"

[Bug libobjc/48626] --enable-objc-gc should be automatic

2024-03-16 Thread iains at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48626

--- Comment #7 from Iain Sandoe  ---
now that boehm-gc is no longer in tree

what should we do with this?

I suppose there could be some more sophisticated top-level configuration
(similar to GMP et. al.) which determines if there's a suitable libgc
available?

[Bug target/42818] Static C++ linking breakage "undefined reference to ___real__Znwj" and others in libcygwin.a(_cygwin_crt0_common.o)

2024-03-16 Thread iains at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42818
Bug 42818 depends on bug 41596, which changed state.

Bug 41596 Summary: handling of library-related options by g++spec.c causes a 
failure when generating pch.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41596

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

[Bug c++/41596] handling of library-related options by g++spec.c causes a failure when generating pch.

2024-03-16 Thread iains at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41596

Iain Sandoe  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #8 from Iain Sandoe  ---
this has been fixed by the improved handling of -static-libstdc++ in r13-4870 
(also in the D and M2 drivers).

[Bug other/35014] Libgfortran.a (downloaded) is not PIC compiled...

2024-03-16 Thread a.shahmoradi at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=35014

--- Comment #14 from Amir Shahmoradi  ---
It's not a bug but a popular requested feature. See, for example, the
discussion here:
https://fortran-lang.discourse.group/t/distribute-shared-libraries-or-not/7532/1
Are there any downsides to distributing PIC-enabled `libgfortran.a` on all
platforms?
For consistency, if this is the default behavior on macOS, it should be the
default on all platforms.

[Bug rtl-optimization/29349] mode switching is inefficient both at compile time and at run time

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=29349

--- Comment #3 from Andrew Pinski  ---
make_preds_opaque was removed with r5-1655-gcbb1e3d98c5f18 .

That revision seems to have partial rewritten mode switching even.


Note mode switching is now used for more on major targets even.

[Bug other/35014] Libgfortran.a (downloaded) is not PIC compiled...

2024-03-16 Thread iains at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=35014

Iain Sandoe  changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |WONTFIX

--- Comment #13 from Iain Sandoe  ---
no feedback since 2021.

[Bug c++/59926] Remove temporary move constructor before move assignment

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59926

--- Comment #3 from Andrew Pinski  ---
GCC and clang produce the same output ...

[Bug tree-optimization/53273] test-cases suffer from cross-function optimizations with no way to mark limits

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53273

--- Comment #9 from Andrew Pinski  ---
(In reply to Hans-Peter Nilsson from comment #8)
> There it is!  I *knew* I had a PR entered for this, and was a bit surprised
> when the ipa attribute was introduced, that this PR wasn't cross-referenced.
> 
> Then again I guess most people don't check in bugzilla for possible entries
> when they fix something, and this one maybe hasn't got any good terms to
> look for.

I think part of it is also finding it independently and fixing it without
looking to see if someone has filed a bug report. I have found a few like this
over the last few years as I try to clean up bugzilla for quality reports.

[Bug testsuite/50036] g++.dg/tree-prof/tree-prof.exp doesn't work correctly

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50036

--- Comment #2 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #1)
> Fixed by r0-117528-gce15c7d5ab96de .

https://gcc.gnu.org/pipermail/gcc-patches/2012-June/342249.html

[Bug testsuite/50036] g++.dg/tree-prof/tree-prof.exp doesn't work correctly

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50036

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |4.8.0
 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #1 from Andrew Pinski  ---
Fixed by r0-117528-gce15c7d5ab96de .

[Bug bootstrap/89494] Bootstrap error when using GCC 4.2.1

2024-03-16 Thread iains at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89494

--- Comment #31 from Iain Sandoe  ---
what is the current situation with this 
 - what input are we waiting for?
 - is the problem now cleared for powerpc64-freebsd?

[Bug bootstrap/88590] System Integrity Protection (SIP) breaks GCC build assumptions on Darwin.

2024-03-16 Thread iains at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88590

Iain Sandoe  changed:

   What|Removed |Added

  Build|x86_64-apple-darwin1[5678]  |x86_64-apple-darwin1[56789]
   ||, *-apple-darwin2*

--- Comment #6 from Iain Sandoe  ---
fixed on trunk using the @rpath mechanism;
TODO - determine if this might reasonably be back-ported.

[Bug middle-end/111646] cos function giving different result for the same input value

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111646

Andrew Pinski  changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |WORKSFORME

--- Comment #6 from Andrew Pinski  ---
[apinski@xeond2 upstream-cross-aarch64]$ ./install/bin/aarch64-linux-gnu-gcc
-static  t67.c -lm
[apinski@xeond2 upstream-cross-aarch64]$ ./install-qemu/bin/qemu-aarch64 a.out
x -9311848.013224 cosx_1 -0.634393
x -9311848.013224 cosx_2 -0.634393


Works for me with the trunk gcc, glibc and qemu.

[Bug jit/102824] building pdf/dvi documentation for libgccjit fails

2024-03-16 Thread iains at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102824

--- Comment #12 from Iain Sandoe  ---
what input is this waiting for at the moment?

[Bug target/108743] [objective-c, NeXT runtime] -fconstant-cfstrings not supported

2024-03-16 Thread iains at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108743

Iain Sandoe  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #15 from Iain Sandoe  ---
(In reply to Eric Gallager from comment #12)
> So I'm assuming this is staying open for backports to the 12 and 11 branches?

yup, which is now done, so fixed.

[Bug target/108743] [objective-c, NeXT runtime] -fconstant-cfstrings not supported

2024-03-16 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108743

--- Comment #14 from GCC Commits  ---
The releases/gcc-11 branch has been updated by Iain D Sandoe
:

https://gcc.gnu.org/g:87152f50a89deb5044145a80fa2ed705f4913f98

commit r11-11283-g87152f50a89deb5044145a80fa2ed705f4913f98
Author: Iain Sandoe 
Date:   Sun Jul 2 14:18:04 2023 +0100

Darwin, Objective-C: Support -fconstant-cfstrings [PR108743].

This support the -fconstant-cfstrings option as used by clang (and
expect by some build scripts) as an alias to the target-specific
-mconstant-cfstrings.

The documentation is also updated to reflect that the 'f' option is
only available on Darwin, and to add the 'm' option to the Darwin
section of the invocation text.

Signed-off-by: Iain Sandoe 

PR target/108743

gcc/ChangeLog:

* config/darwin.opt: Add fconstant-cfstrings alias to
mconstant-cfstrings.
* doc/invoke.texi: Amend invocation descriptions to reflect
that the fconstant-cfstrings is a target-option alias and to
add the missing mconstant-cfstrings option description to the
Darwin section.

(cherry picked from commit cdd4b3c0f0f428678c24de74b1f626628450799c)

[Bug target/108743] [objective-c, NeXT runtime] -fconstant-cfstrings not supported

2024-03-16 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108743

--- Comment #13 from GCC Commits  ---
The releases/gcc-12 branch has been updated by Iain D Sandoe
:

https://gcc.gnu.org/g:215d67485ce8d4f6cef4e9cf7ecfd4d79abc1c48

commit r12-10219-g215d67485ce8d4f6cef4e9cf7ecfd4d79abc1c48
Author: Iain Sandoe 
Date:   Sun Jul 2 14:18:04 2023 +0100

Darwin, Objective-C: Support -fconstant-cfstrings [PR108743].

This support the -fconstant-cfstrings option as used by clang (and
expect by some build scripts) as an alias to the target-specific
-mconstant-cfstrings.

The documentation is also updated to reflect that the 'f' option is
only available on Darwin, and to add the 'm' option to the Darwin
section of the invocation text.

Signed-off-by: Iain Sandoe 

PR target/108743

gcc/ChangeLog:

* config/darwin.opt: Add fconstant-cfstrings alias to
mconstant-cfstrings.
* doc/invoke.texi: Amend invocation descriptions to reflect
that the fconstant-cfstrings is a target-option alias and to
add the missing mconstant-cfstrings option description to the
Darwin section.

(cherry picked from commit cdd4b3c0f0f428678c24de74b1f626628450799c)

[Bug libgcc/113402] Incorrect symbol versions for __builtin_nested_func_ptr_created, __builtin_nested_func_ptr in libgcc_s.so.1

2024-03-16 Thread iains at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113402

--- Comment #9 from Iain Sandoe  ---
I think this is fixed now?

[Bug target/111231] [12/13/14 regression] armhf: Miscompilation with -O2/-fno-exceptions level (-fno-tree-vectorize is working)

2024-03-16 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111231

Sam James  changed:

   What|Removed |Added

   Target Milestone|--- |12.4
 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1
   Last reconfirmed||2024-03-17

--- Comment #18 from Sam James  ---
Confirmed.

[Bug target/111231] [12/13/14 regression] armhf: Miscompilation with -O2/-fno-exceptions level (-fno-tree-vectorize is working)

2024-03-16 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111231

Sam James  changed:

   What|Removed |Added

  Known to fail||14.0
  Known to work||11.4.1
Summary|armhf: Miscompilation with  |[12/13/14 regression]
   |-O2/-fno-exceptions level   |armhf: Miscompilation with
   |(-fno-tree-vectorize is |-O2/-fno-exceptions level
   |working)|(-fno-tree-vectorize is
   ||working)

--- Comment #17 from Sam James  ---
Adding missing regression markers. 11 is fine for me.

[Bug target/91905] OpenBLAS LAPACK icamax miscompiled

2024-03-16 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91905

Sam James  changed:

   What|Removed |Added

 CC||sjames at gcc dot gnu.org
 Status|NEW |WAITING

--- Comment #6 from Sam James  ---
-> WAITING.

[Bug target/52908] xop-mul-1:f9 miscompiled on bulldozer (-mxop)

2024-03-16 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52908

Sam James  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |4.7.2
 CC||sjames at gcc dot gnu.org

--- Comment #10 from Sam James  ---
Long fixed, the backport landed in 4.7.2.

[Bug target/53071] Wrong instruction replacement when compiling for xop

2024-03-16 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53071
Bug 53071 depends on bug 52908, which changed state.

Bug 52908 Summary: xop-mul-1:f9 miscompiled on bulldozer (-mxop)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52908

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

[Bug tree-optimization/49946] Thread jumps confuse loop unrolling

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49946

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |12.0
 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from Andrew Pinski  ---
Fixed.

[Bug tree-optimization/32073] Loop unrolling does not exploit VRP for loop bound

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=32073

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |FIXED
   Target Milestone|--- |4.9.0
 Status|NEW |RESOLVED

--- Comment #3 from Andrew Pinski  ---
Fixed in GCC 4.9.0.

[Bug tree-optimization/59875] Missed unrolling opportunity

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59875

--- Comment #5 from Andrew Pinski  ---
Reduced testcase:
```
void foo1()
{
  char *a[4] = {nullptr, nullptr, nullptr, nullptr};
  char **b = [4];
  while (b!=[0])
  {
b--;
if (*b) __builtin_free(*b);
  }
}
```

size: 10-3, last_iteration: 10-3
  Loop size: 10
  Estimated size after unrolling: 18
Not unrolling loop 3: contains call and code would grow.


There is another bug similar to this where we could decrease the cost slightly
if we know that a[i] is stored above and might eliminate the branch.

[Bug libstdc++/61735] pre-C++11 basic_string bug when type_size is char (-D_GLIBCXX_USE_CXX11_ABI=0)

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61735

Andrew Pinski  changed:

   What|Removed |Added

Summary|basic_string bug when   |pre-C++11 basic_string bug
   |type_size is char.  |when type_size is char
   ||(-D_GLIBCXX_USE_CXX11_ABI=0
   ||)

--- Comment #3 from Andrew Pinski  ---
I will note that the (default) newer basic_string that was included in GCC 5+
does not have this issue but the pre-c++ ABI basic_string still has this issue.
That is you need -D_GLIBCXX_USE_CXX11_ABI=0 to hit the issue now.

[Bug c++/84411] Missed optimization: static guard variable generated for empty virtual destructor

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84411

Andrew Pinski  changed:

   What|Removed |Added

 CC||antoshkka at gmail dot com

--- Comment #3 from Andrew Pinski  ---
*** Bug 87831 has been marked as a duplicate of this bug. ***

[Bug middle-end/87831] Guard variable is not eliminated when there's nothing to guard

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87831

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |DUPLICATE
 Status|NEW |RESOLVED

--- Comment #2 from Andrew Pinski  ---
Dup of bug 84411, the deconstructor part there is a different issue and has a
fix waiting on GCC 15 though.

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

[Bug c++/53785] coalescing multiple static instances in function scope

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53785

Andrew Pinski  changed:

   What|Removed |Added

 CC||antoshkka at gmail dot com

--- Comment #4 from Andrew Pinski  ---
*** Bug 87692 has been marked as a duplicate of this bug. ***

[Bug c++/87692] Reuse guard variable for multiple initializations

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87692

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |DUPLICATE
 Status|NEW |RESOLVED

--- Comment #3 from Andrew Pinski  ---
Dup.

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

[Bug c++/53785] coalescing multiple static instances in function scope

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53785

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
  Component|tree-optimization   |c++
   Last reconfirmed||2024-03-17
 Ever confirmed|0   |1
   Keywords||ABI

--- Comment #3 from Andrew Pinski  ---
Confirmed.

[Bug c++/78940] [missed optimization] Useless guard variable in thread_local defaulted constructor

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78940

Andrew Pinski  changed:

   What|Removed |Added

 CC||klaus.doldinger64@googlemai
   ||l.com

--- Comment #7 from Andrew Pinski  ---
*** Bug 83730 has been marked as a duplicate of this bug. ***

[Bug c++/83730] Unnecessary generation of guard variables with -fno-threadsafe-statics

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83730

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |DUPLICATE
 Status|NEW |RESOLVED

--- Comment #8 from Andrew Pinski  ---
Dup, and fixed already.

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

[Bug tree-optimization/53273] test-cases suffer from cross-function optimizations with no way to mark limits

2024-03-16 Thread hp at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53273

--- Comment #8 from Hans-Peter Nilsson  ---
There it is!  I *knew* I had a PR entered for this, and was a bit surprised
when the ipa attribute was introduced, that this PR wasn't cross-referenced.

Then again I guess most people don't check in bugzilla for possible entries
when they fix something, and this one maybe hasn't got any good terms to look
for.

(In reply to Andrew Pinski from comment #7)
> The noipa attribute is used for this now.

It sure is and spot on.

[Bug c++/78940] [missed optimization] Useless guard variable in thread_local defaulted constructor

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78940

Andrew Pinski  changed:

   What|Removed |Added

 CC||marc.mutz at hotmail dot com

--- Comment #6 from Andrew Pinski  ---
*** Bug 79561 has been marked as a duplicate of this bug. ***

[Bug c++/79561] Missed optimization: useless guards for zero-initialized POD statics with =default default ctor at function scope

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79561

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #3 from Andrew Pinski  ---
Yes it is a dup of bug 78940 and was fixed for GCC 10.4.0.

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

[Bug c++/78940] [missed optimization] Useless guard variable in thread_local defaulted constructor

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78940

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |10.4

[Bug middle-end/24639] [meta-bug] bug to track all Wuninitialized issues

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24639
Bug 24639 depends on bug 68548, which changed state.

Bug 68548 Summary: bogus "may be used uninitialized" (predicate analysis)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68548

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

[Bug tree-optimization/68548] bogus "may be used uninitialized" (predicate analysis)

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68548

Andrew Pinski  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
   Keywords||missed-optimization
   Target Milestone|--- |14.0
 Resolution|--- |FIXED

--- Comment #4 from Andrew Pinski  ---
Fixed on the trunk. A jump threading improvement fixed it.

[Bug tree-optimization/19794] [meta-bug] Jump threading related bugs

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=19794
Bug 19794 depends on bug 68548, which changed state.

Bug 68548 Summary: bogus "may be used uninitialized" (predicate analysis)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68548

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

[Bug c++/36587] Feature: add warning for constructor call with discarded return.

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36587

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |FIXED
   Target Milestone|--- |7.0
 Status|UNCONFIRMED |RESOLVED

--- Comment #14 from Andrew Pinski  ---
C++17 adds nodiscard attribute which can be placed on class/struct types,
functions, constructors and others and then you get a warning if you ignore the
value. In the case of struct/class types and constructors that will warn when a
temporary value is ignored. Exactly in the case you were asking for a warning.

Which was added to GCC by r7-377-gb632761d2c6a65 (and fixes afterwards).

So closing as fixed.

[Bug c++/109268] Guard variable still provided for static constinit variable with an empty destructor

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109268

Andrew Pinski  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Last reconfirmed||2024-03-16
 Status|UNCONFIRMED |NEW
 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #3 from Andrew Pinski  ---
I have a patch which fixes PR 19661 except it does not fix this one fully.

I will also note LLVM also still does the guard variable here too even with the
removal of the __cxa_atexit call.

We need another way to remove the empty code between
__cxa_guard_acquire/__cxa_guard_release .

   [local count: 354334800]:
  _2 = __cxa_guard_acquire (&_ZGVZ1fvE4data);
  if (_2 != 0)
goto ; [33.00%]
  else
goto ; [67.00%]

   [local count: 116930483]:
  # DEBUG this => 
  # DEBUG INLINE_ENTRY __ct 
  data ={v} {CLOBBER(bob)};
  # DEBUG this => NULL
  __cxa_guard_release (&_ZGVZ1fvE4data);

   [local count: 1073741824]:

--- Comment #4 from Andrew Pinski  ---
Dup in the end.

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

[Bug c++/84411] Missed optimization: static guard variable generated for empty virtual destructor

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84411

Andrew Pinski  changed:

   What|Removed |Added

 CC||barry.revzin at gmail dot com

--- Comment #2 from Andrew Pinski  ---
*** Bug 109268 has been marked as a duplicate of this bug. ***

[Bug c++/84411] Missed optimization: static guard variable generated for empty virtual destructor

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84411

Andrew Pinski  changed:

   What|Removed |Added

 Depends on||19661
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2024-03-16
 Ever confirmed|0   |1
 CC||pinskia at gcc dot gnu.org

--- Comment #1 from Andrew Pinski  ---
This depends on PR 19661.

But then we still need to remove:
   [local count: 1073741824]:
  _1 = __atomic_load_1 (&_ZGVZ8get_basevE1d, 2);
  if (_1 == 0)
goto ; [33.00%]
  else
goto ; [67.00%]
   [local count: 956811341]:
  goto ; [100.00%]

   [local count: 354334800]:
  _2 = __cxa_guard_acquire (&_ZGVZ8get_basevE1d);
  if (_2 != 0)
goto ; [33.00%]
  else
goto ; [67.00%]

   [local count: 116930483]:
  __cxa_guard_release (&_ZGVZ8get_basevE1d);


Note clang/LLVM does not remove the use of the guard here either, even though
it does remove the __cxa_atexit.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=19661
[Bug 19661] unnecessary atexit calls emitted for static objects with empty
destructors

[Bug c++/78940] [missed optimization] Useless guard variable in thread_local defaulted constructor

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78940

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=104142
 Resolution|--- |FIXED

--- Comment #5 from Andrew Pinski  ---
Fixed in GCC 10.4.0 by the patch which fixed PR 104142.

[Bug c++/59994] [meta-bug] thread_local

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59994
Bug 59994 depends on bug 78940, which changed state.

Bug 78940 Summary: [missed optimization] Useless guard variable in thread_local 
defaulted constructor
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78940

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

[Bug c++/78940] [missed optimization] Useless guard variable in thread_local defaulted constructor

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78940

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement
  Known to work||10.4.0, 10.5.0, 11.4.0,
   ||12.1.0

[Bug tree-optimization/19661] unnecessary atexit calls emitted for static objects with empty destructors

2024-03-16 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=19661

Fangrui Song  changed:

   What|Removed |Added

 CC||i at maskray dot me

--- Comment #17 from Fangrui Song  ---
(In reply to Andrew Pinski from comment #16)
> So what is interesting is the way LLVM implements this as an IPO pass as how
> I described in comment #8, 6 years after I wrote that. Well they used
> "empty" rather than const . Note using it as an IPO pass I think is not
> wrong just having a specialized pass here where this is the same as DCE so
> just have DCE handle it instead seems better; plus with the availability of
> having pure/const flags with LTO and not having to load in the function
> seems much better really.

Yes, LLVM recognizes __cxa_atexit as a library function and removes it in
GlobalOpt (part of IPO) since 2011
(https://github.com/llvm/llvm-project/commit/ee6bc70d2f1c2434ca9ca8092216bdeab322c7e5),
likely because
GlobalOpt is already doing global variable optimizations (e.g. removal if dead,
constant folding). Technically __cxa_atexit removal can be moved elsewhere.

There are two GlobalOpt passes in the optimization pipeline (see -mllvm
-print-changed=cdiff output), one before the inliner and one after.

  SROA
  ...
  GlobalOpt
  ...
  buildInlinerPipeline
  ...
  GlobalOpt

For empty functions like `~constant_init() {}`, SROA deletes unneeded IR
instructions (spill of the "this" pointer) and actually makes the IR function
empty. Then GlobalOpt removes __cxa_atexit call sites.

For `static void empty() {} ~constant_init() { empty(); }`, the inliner removes
the `empty()` and makes the IR function empty. Then GlobalOpt removes
__cxa_atexit call sites.

[Bug c++/109268] Guard variable still provided for static constinit variable with an empty destructor

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109268

Andrew Pinski  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Last reconfirmed||2024-03-16
 Status|UNCONFIRMED |NEW

--- Comment #3 from Andrew Pinski  ---
I have a patch which fixes PR 19661 except it does not fix this one fully.

I will also note LLVM also still does the guard variable here too even with the
removal of the __cxa_atexit call.

We need another way to remove the empty code between
__cxa_guard_acquire/__cxa_guard_release .

   [local count: 354334800]:
  _2 = __cxa_guard_acquire (&_ZGVZ1fvE4data);
  if (_2 != 0)
goto ; [33.00%]
  else
goto ; [67.00%]

   [local count: 116930483]:
  # DEBUG this => 
  # DEBUG INLINE_ENTRY __ct 
  data ={v} {CLOBBER(bob)};
  # DEBUG this => NULL
  __cxa_guard_release (&_ZGVZ1fvE4data);

   [local count: 1073741824]:

[Bug libstdc++/114367] std::vector constexpr initialization doesn't start lifetime of array members

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114367

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2024-03-16
 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW

--- Comment #2 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #1)
> Hmm:
> 
> _Bit_pointer __p = _Bit_alloc_traits::allocate(_M_impl,
> _S_nword(__n));
> #if __cpp_lib_is_constant_evaluated
> if (std::is_constant_evaluated())
> {
>   __n = _S_nword(__n);
>   for (size_t __i = 0; __i < __n; ++__i)
> __p[__i] = 0ul;
> }
> #endif
> 
> Maybe I misunderstand how this should work.

Oh yes see https://github.com/llvm/llvm-project/issues/46391

So yes this is a GCC bug with the above.

[Bug libstdc++/114367] std::vector constexpr initialization doesn't start lifetime of array members

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114367

--- Comment #1 from Andrew Pinski  ---
Hmm:

_Bit_pointer __p = _Bit_alloc_traits::allocate(_M_impl, _S_nword(__n));
#if __cpp_lib_is_constant_evaluated
if (std::is_constant_evaluated())
{
  __n = _S_nword(__n);
  for (size_t __i = 0; __i < __n; ++__i)
__p[__i] = 0ul;
}
#endif

Maybe I misunderstand how this should work.

[Bug libstdc++/114367] New: std::vector constexpr initialization doesn't start lifetime of array members

2024-03-16 Thread teodor_spaeren at riseup dot net via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114367

Bug ID: 114367
   Summary: std::vector constexpr initialization doesn't
start lifetime of array members
   Product: gcc
   Version: 13.2.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: teodor_spaeren at riseup dot net
  Target Milestone: ---

#include
consteval int foo(){
std::vectorseen(26);
return 0;
}
int main(){
return foo();
}

This is the code. If you compile this with g++, it compiles fine, but with
clang it gives a warning about object lifetimes.

lel.cpp:7:12: error: call to consteval function 'foo' is not a constant
expression
return foo();
   ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../include/c++/13.2.1/bits/stl_bvector.h:649:15:
note: assignment to object outside its lifetime is not allowed in a constant
expression
__p[__i] = 0ul;
 ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../include/c++/13.2.1/bits/stl_bvector.h:1317:31:
note: in call to '>_M_allocate(1)'
_Bit_pointer __q = this->_M_allocate(__n);
 ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../include/c++/13.2.1/bits/stl_bvector.h:768:2:
note: in call to '>_M_initialize(26)'
_M_initialize(__n);
^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../include/c++/13.2.1/bits/stl_bvector.h:755:9:
note: in call to 'vector(26, false, allocator_type())'
  : vector(__n, false, __a)
^
lel.cpp:3:22: note: in call to 'vector(26, allocator_type())'
std::vectorseen(26);
 ^
lel.cpp:7:12: note: in call to 'foo()'
return foo();
   ^
1 error generated.

When compiling with 

https://github.com/gcc-mirror/gcc/blob/releases/gcc-13/libstdc%2B%2B-v3/include/bits/stl_bvector.h#L676-L685

In the code it seems it never constructs the array, but starts accessing the
members directly. I don't know if this is affected by
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p0593r6.html or not.
I've submitted a bug report to clang also.

[Bug sanitizer/59286] segfault in __sanitizer::StackDepotGet

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59286

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |INVALID
 Status|UNCONFIRMED |RESOLVED

--- Comment #12 from Andrew Pinski  ---
Invalid as mentioned, stack size increases slightly with tsan enabled which
causes the needed increase in stack size overall.

[Bug preprocessor/53212] cpp consumes comment after pragma

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53212

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2024-03-16
 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW

--- Comment #2 from Andrew Pinski  ---
ICC/EDG on the other hand includes the comment.

So confirmed.

[Bug preprocessor/53212] cpp consumes comment after pragma

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53212

--- Comment #1 from Andrew Pinski  ---
Hmm, clang has the same behavior here ...
I don't know if it is the right one though.

[Bug target/56603] Different _MM_HINT_TX values from ICC

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56603

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |INVALID
 Status|UNCONFIRMED |RESOLVED

--- Comment #1 from Andrew Pinski  ---
The intrinsics guide:
https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_prefetch_expand=5152,5153


_MM_HINT_T0 // 3, move data using the T0 hint. The PREFETCHT0 instruction will
be generated.
_MM_HINT_T1 // 2, move data using the T1 hint. The PREFETCHT1 instruction will
be generated.
_MM_HINT_T2 // 1, move data using the T2 hint. The PREFETCHT2 instruction will
be generated.

So GCC is correct here.

[Bug preprocessor/56306] -m32 does not support all includes

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56306

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |INVALID
 Status|UNCONFIRMED |RESOLVED

--- Comment #4 from Andrew Pinski  ---
Debian and Ubuntu solves this using the mutli-arch (which GCC has support for a
few years now).

But this is a distro issue rather than a GCC issue.

[Bug tree-optimization/53273] test-cases suffer from cross-function optimizations with no way to mark limits

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53273

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #7 from Andrew Pinski  ---
The noipa attribute is used for this now.



In this case, adding noipa to foobar, removes the noreturn detection of foobar
and there is no code difference with/without foobar defined in there.


__attribute__ ((noipa))
extern void foobar(void *);

[Bug target/51122] ICE in change_address_1, at emit-rtl.c:2001

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51122

Andrew Pinski  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |5.0

--- Comment #2 from Andrew Pinski  ---
Fixed for GCC 5+ (Maybe even for GCC 4.9). LRA is always enabled in GCC 5+
(r5-6635-gc896d4b449d797)

[Bug driver/111527] COLLECT_GCC_OPTIONS option hits single-variable limits too early

2024-03-16 Thread slyfox at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111527

--- Comment #5 from Sergei Trofimovich  ---
(In reply to Deepthi H from comment #4)
> I have been investigating this issue further. Hence checking the source code
> and debugging the gcc sources. However, I wasn't able to find where the
> COLLECT_GCC_OPTION has been set to 128kb
> 
> I couldn't find it being set in gcc. Can you please let us know how can we
> increase the limit of collect options?

The 128K limit against a single environment variable is a linux kernel
limitation set by this define in include/uapi/linux/binfmts.h:

#define MAX_ARG_STRLEN (PAGE_SIZE * 32)

https://trofi.github.io/posts/299-maximum-argument-count-on-linux-and-in-gcc.html
has more words on that.

[Bug target/46247] bug with loading constant to neon quad register

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46247

--- Comment #2 from Andrew Pinski  ---
The code looks correct in GCC 4.5.4 and above.

[Bug c++/43127] Inconsistent and odd constructor calls.

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43127

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |INVALID

--- Comment #4 from Andrew Pinski  ---
First note C++17+ changed the rules so using C++17 allows this to compile,
guaranteed copy elision
(https://en.cppreference.com/w/cpp/language/copy_elision) so no copy is
required or even tried.

Second, the code is in fact invalid C++98/03/11/14 .

To make it valid C++11/14, you can use the rvalue reference instead for the
constructor:
auto_ptr(auto_ptr&& source)

For valid C++98, you could add a constructor which takes a const reference
which allows binding a temporary to it:
auto_ptr(const auto_ptr& source)

[Bug debug/44712] Debug info for partially inlined functions

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44712

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2024-03-16
 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1

--- Comment #3 from Andrew Pinski  ---
.

[Bug middle-end/113396] [13/14 Regression] csmith: differences from -O2 to -O3

2024-03-16 Thread dcb314 at hotmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113396

--- Comment #19 from David Binderman  ---
gcc 12.3 seems to get it right:

foundBugs $ ~/gcc/results.12.3.asan.ubsan/bin/gcc -w -O2
--param=max-inline-insns-auto=23 bug998.c &&  valgrind -q ./a.out
checksum = 77A231E6
foundBugs $ ~/gcc/results.12.3.asan.ubsan/bin/gcc -w -O2
--param=max-inline-insns-auto=24 bug998.c &&  valgrind -q ./a.out
checksum = 77A231E6
foundBugs $ ~/gcc/results.12.3.asan.ubsan/bin/gcc -w -O2
--param=max-inline-insns-auto=30 bug998.c &&  valgrind -q ./a.out
checksum = 77A231E6
foundBugs $ ~/gcc/results.12.3.asan.ubsan/bin/gcc -w -O3  bug998.c &&  valgrind
-q ./a.out
checksum = 77A231E6
foundBugs $

[Bug c++/99242] [modules] ICE in lookup_mark, at cp/tree.c:2403

2024-03-16 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99242

--- Comment #4 from Patrick Palka  ---
A curious reduction:

$ cat 99242_a.H
bool __is_constant_evaluated();

$ cat 99242_b.H
bool __is_constant_evaluated();

$ cat 99242_c.H
bool __is_constant_evaluated();

$ cat 99242_d.C
bool __is_constant_evaluated(); 
import "99242_a.H";
void f() { __is_constant_evaluated(); } 
import "99242_b.H";
import "99242_c.H"; 
void g() { __is_constant_evaluated(); } 

$ g++ -fmodules-ts 99241_*
99242_d.C: In function ‘void g()’:
99242_d.C:6:12: internal compiler error: in lookup_mark, at cp/tree.cc:2474
6 | void g() { __is_constant_evaluated(); }
  |^~~

[Bug c++/99241] [modules] ICE in install_entity, at cp/module.cc:7584

2024-03-16 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99241

Patrick Palka  changed:

   What|Removed |Added

 CC||ppalka at gcc dot gnu.org

--- Comment #9 from Patrick Palka  ---
Reduced (needs -fno-module-lazy):

$ cat 99241_a.H
void terminate();

$ cat 99241_b.H
void terminate();

$ cat 99241_c.C
import "99242_a.H";
void terminate();
import "99242_b.H";

$ g++ -fmodules-ts -fno-module-lazy 99241_*
99242_c.H:3:20: internal compiler error: in install_entity, at
cp/module.cc:7649
3 | import "99242_b.H";
  |^
0x77821f trees_in::install_entity(tree_node*)

[Bug c++/99242] [modules] ICE in lookup_mark, at cp/tree.c:2403

2024-03-16 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99242

Patrick Palka  changed:

   What|Removed |Added

 CC||ppalka at gcc dot gnu.org

--- Comment #3 from Patrick Palka  ---
A curious reduction:

$ cat 99241_a.H
bool __is_constant_evaluated();

$ cat 99241_b.H
bool __is_constant_evaluated();

$ cat 99241_c.H
bool __is_constant_evaluated();

$ cat 99241_d.C
bool __is_constant_evaluated(); 
import "99241_a.ii";
void f() { __is_constant_evaluated(); } 
import "99241_b.ii";
import "99241_c.ii";
void g() { __is_constant_evaluated(); } 

$ g++ -fmodules-ts 99241_*
99241_d.ii: In function ‘void g()’:
99241_d.ii:6:12: internal compiler error: in lookup_mark, at cp/tree.cc:2474
6 | void g() { __is_constant_evaluated(); }
  |^~~

[Bug c++/114362] wrong error message "too many arguments" with overloaded function

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114362

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |DUPLICATE
 Status|UNCONFIRMED |RESOLVED

--- Comment #1 from Andrew Pinski  ---
Dup.

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

[Bug c++/104343] improved error message for passing overloaded function to variadic(templated)-argument function

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104343

Andrew Pinski  changed:

   What|Removed |Added

 CC||f.heckenb...@fh-soft.de

--- Comment #6 from Andrew Pinski  ---
*** Bug 114362 has been marked as a duplicate of this bug. ***

[Bug c++/44298] code addressed only by label with it's address taken is ignored

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44298

Andrew Pinski  changed:

   What|Removed |Added

 CC||inaoka.kazuhiro at renesas dot 
com

--- Comment #12 from Andrew Pinski  ---
*** Bug 28581 has been marked as a duplicate of this bug. ***

[Bug middle-end/28581] Illegal loading the address of a label with -O2

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28581

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|INVALID |DUPLICATE

--- Comment #14 from Andrew Pinski  ---


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

[Bug c++/44298] code addressed only by label with it's address taken is ignored

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44298

Andrew Pinski  changed:

   What|Removed |Added

 CC||jeremy at goop dot org

--- Comment #11 from Andrew Pinski  ---
*** Bug 29305 has been marked as a duplicate of this bug. ***

[Bug middle-end/29305] local label-as-value being placed before function prolog

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=29305

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|INVALID |DUPLICATE

--- Comment #12 from Andrew Pinski  ---


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

[Bug c/19969] Labels broken when passed into inline assembly.

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=19969

--- Comment #3 from Andrew Pinski  ---
Note starting with GCC 4.5, gcc adds asm goto which can be used to do what is
needed to be done here.

[Bug c++/44298] code addressed only by label with it's address taken is ignored

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44298

Andrew Pinski  changed:

   What|Removed |Added

 CC||Wasserthal at nefkom dot net

--- Comment #10 from Andrew Pinski  ---
*** Bug 54529 has been marked as a duplicate of this bug. ***

[Bug c/54529] dead code elimination deletes code adressed by referenced labels

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54529

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|INVALID |DUPLICATE

--- Comment #2 from Andrew Pinski  ---
.

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

[Bug modula2/114296] ICE when attempting to create a constant set with a variable element

2024-03-16 Thread gaius at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114296

--- Comment #1 from Gaius Mulley  ---
Created attachment 57719
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57719=edit
Proposed fix

Here is the proposed fix.  It corrects the virtual token creation for the
aggregate constant and also corrects tokens for constructor components.

[Bug c++/44298] code addressed only by label with it's address taken is ignored

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44298

Andrew Pinski  changed:

   What|Removed |Added

 CC||fw at gcc dot gnu.org

--- Comment #9 from Andrew Pinski  ---
*** Bug 77951 has been marked as a duplicate of this bug. ***

[Bug rtl-optimization/77951] Incorrect placement of label which does not affect execution flow

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77951

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|INVALID |DUPLICATE

--- Comment #2 from Andrew Pinski  ---
.

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

[Bug c/77329] gcc doesn't always correctly calculate label addresses

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77329

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|INVALID |DUPLICATE

--- Comment #2 from Andrew Pinski  ---


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

[Bug c++/44298] code addressed only by label with it's address taken is ignored

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44298

Andrew Pinski  changed:

   What|Removed |Added

 CC||dhowells at redhat dot com

--- Comment #8 from Andrew Pinski  ---
*** Bug 77329 has been marked as a duplicate of this bug. ***

[Bug c++/44298] code addressed only by label with it's address taken is ignored

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44298

Andrew Pinski  changed:

   What|Removed |Added

 CC||thomas.lynch@reasoningtechn
   ||ology.com

--- Comment #7 from Andrew Pinski  ---
*** Bug 96956 has been marked as a duplicate of this bug. ***

[Bug c/96956] When gcc does not see a label used in a goto it gives the wrong label address &

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96956

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|INVALID |DUPLICATE

--- Comment #3 from Andrew Pinski  ---
.

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

[Bug c/112870] incorrect jmp when using goto on a function, causing infinite loop

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112870

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|INVALID |DUPLICATE

--- Comment #4 from Andrew Pinski  ---


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

[Bug c++/44298] code addressed only by label with it's address taken is ignored

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44298

Andrew Pinski  changed:

   What|Removed |Added

 CC||grantrwittmann at gmail dot com

--- Comment #6 from Andrew Pinski  ---
*** Bug 112870 has been marked as a duplicate of this bug. ***

[Bug c/40115] -O2 and higher causes wrong label address calculation

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40115

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|INVALID |DUPLICATE

--- Comment #7 from Andrew Pinski  ---
.

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

[Bug c++/44298] code addressed only by label with it's address taken is ignored

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44298

Andrew Pinski  changed:

   What|Removed |Added

 CC||sergstesh at yahoo dot com

--- Comment #5 from Andrew Pinski  ---
*** Bug 40115 has been marked as a duplicate of this bug. ***

[Bug c/55749] gcc 4.7.1 removes labels mistakenly

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55749

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|INVALID |DUPLICATE

--- Comment #5 from Andrew Pinski  ---
.

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

[Bug c++/44298] code addressed only by label with it's address taken is ignored

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44298

Andrew Pinski  changed:

   What|Removed |Added

 CC||blue_3too at hotmail dot com

--- Comment #4 from Andrew Pinski  ---
*** Bug 55749 has been marked as a duplicate of this bug. ***

[Bug c++/44298] code addressed only by label with it's address taken is ignored

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44298

Andrew Pinski  changed:

   What|Removed |Added

 CC||martin.girard5 at gmail dot com

--- Comment #3 from Andrew Pinski  ---
*** Bug 55468 has been marked as a duplicate of this bug. ***

[Bug c++/55468] Label value to incorrect destination

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55468

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|INVALID |DUPLICATE

--- Comment #4 from Andrew Pinski  ---
Dup.

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

[Bug c/114366] computed labels do not reflect true values of instruction pointer ranges when function is inlined

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114366

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|INVALID |DUPLICATE

--- Comment #3 from Andrew Pinski  ---
Dup.

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

[Bug c++/44298] code addressed only by label with it's address taken is ignored

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44298

Andrew Pinski  changed:

   What|Removed |Added

 CC||godmar at gmail dot com

--- Comment #2 from Andrew Pinski  ---
*** Bug 114366 has been marked as a duplicate of this bug. ***

[Bug middle-end/26187] computed goto code does not produce jumps

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26187

Andrew Pinski  changed:

   What|Removed |Added

 CC||rakdver at gcc dot gnu.org

--- Comment #3 from Andrew Pinski  ---
*** Bug 31727 has been marked as a duplicate of this bug. ***

[Bug tree-optimization/31727] Functions with non-local gotos are considered not to have side effects

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31727

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|INVALID |DUPLICATE

--- Comment #5 from Andrew Pinski  ---
Dup.

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

[Bug c/114366] computed labels do not reflect true values of instruction pointer ranges when function is inlined

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114366

--- Comment #2 from Andrew Pinski  ---
To use these values, you need to be able to jump to one. This is done with the
computed goto statement6

[Bug c/114366] computed labels do not reflect true values of instruction pointer ranges when function is inlined

2024-03-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114366

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |INVALID
 Status|UNCONFIRMED |RESOLVED

--- Comment #1 from Andrew Pinski  ---
Using labels as values can only be used with computed gotos. This is documented
that way too.

[Bug c/114366] New: computed labels do not reflect true values of instruction pointer ranges when function is inlined

2024-03-16 Thread godmar at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114366

Bug ID: 114366
   Summary: computed labels do not reflect true values of
instruction pointer ranges when function is inlined
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: godmar at gmail dot com
  Target Milestone: ---

Created attachment 57718
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57718=edit
using labels as values example

Hi, we recently got tripped up by the following:

```c
#include 

void *beginPtr, *endPtr;
int x;
static void smallfunction(void)
{
beginPtr = &
endPtr = &
begin:
x++;
end:
}

int
main()
{
smallfunction();
assert(beginPtr < endPtr);
}
```
When compiled with `-O0`, this program completes successfully. When compiled
with `-O2`, this program fails its assertion because the following assembly
code is produced:

```
.L2:
.L3:
leaq.L2(%rip), %rdx
leaq.L3(%rip), %rax
addl$1, x(%rip)
```

which IMO should be something like:
```
.L2:
leaq.L2(%rip), %rdx
leaq.L3(%rip), %rax
addl$1, x(%rip)
.L3:
```

I understand that using labels as values is a GCC extension, and I have read
the comment in the documentation [1] that warns that & might have a
different value if a function is inlined.  (Adding the noinline attribute fixes
the problem at the cost of some performance.)  Also note that "different
values" is not the same as not being computed correctly.

We encountered this problem building an exception handler.

I will note that gcc will not inline the function if the computed values are
actually used in a goto statement; when trying to force it to inline it, it
throws an error.

Is this a bug, or undocumented behavior? Perhaps the documentation should be
clarified.  

[1] https://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html

  1   2   >