public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/105578] New: `constexpr` does not work on powerpc
@ 2022-05-12  8:57 liushuyu011 at gmail dot com
  2022-05-12  9:27 ` [Bug c++/105578] " pinskia at gcc dot gnu.org
  2022-05-12 10:18 ` redi at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: liushuyu011 at gmail dot com @ 2022-05-12  8:57 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105578
           Summary: `constexpr` does not work on powerpc
           Product: gcc
           Version: 11.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: liushuyu011 at gmail dot com
  Target Milestone: ---

`constexpr` does not work on PowerPC when you use `-mabi=ibmlongdouble`.

Example code (this code snippet is considered well-formed by GCC on other
architectures):

#include <stdint.h>

constexpr long double LD_E =
2.71828182845904523536028747135266249775724709369995;
constexpr long double LD_E_R = 1.0 / LD_E;

GCC will produce an error:

test.c:4:36: error: '(1.0e+0l / 2.71828182845904509079559829842765e+0l)' is not
a constant expression
    4 | constexpr long double LD_E_R = 1.0 / LD_E;
      |                                ~~~~^~~~~~

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

* [Bug c++/105578] `constexpr` does not work on powerpc
  2022-05-12  8:57 [Bug c++/105578] New: `constexpr` does not work on powerpc liushuyu011 at gmail dot com
@ 2022-05-12  9:27 ` pinskia at gcc dot gnu.org
  2022-05-12 10:18 ` redi at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-05-12  9:27 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 19779 which I filed over 17 years ago.

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

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

* [Bug c++/105578] `constexpr` does not work on powerpc
  2022-05-12  8:57 [Bug c++/105578] New: `constexpr` does not work on powerpc liushuyu011 at gmail dot com
  2022-05-12  9:27 ` [Bug c++/105578] " pinskia at gcc dot gnu.org
@ 2022-05-12 10:18 ` redi at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: redi at gcc dot gnu.org @ 2022-05-12 10:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to shuyu liu from comment #0)
> `constexpr` does not work on PowerPC when you use `-mabi=ibmlongdouble`.

That's a pretty bold claim! **Some** long double arithmetic does not work in
constant expressions.

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

end of thread, other threads:[~2022-05-12 10:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-12  8:57 [Bug c++/105578] New: `constexpr` does not work on powerpc liushuyu011 at gmail dot com
2022-05-12  9:27 ` [Bug c++/105578] " pinskia at gcc dot gnu.org
2022-05-12 10:18 ` redi 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).