public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/103487] New: "paranoia" Makefile target in gcc/Makefile fails to build
@ 2021-11-30  9:04 egallager at gcc dot gnu.org
  2023-11-19  4:51 ` [Bug other/103487] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: egallager at gcc dot gnu.org @ 2021-11-30  9:04 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103487
           Summary: "paranoia" Makefile target in gcc/Makefile fails to
                    build
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: build
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: egallager at gcc dot gnu.org
                CC: rth at gcc dot gnu.org
  Target Milestone: ---

Looks like contrib/paranoia.cc hasn't been updated in a while:

g++ -c   -g  -DIN_GCC -fPIC   -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute
-Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros
-Wno-overlength-strings -Wold-style-definition -Wc++-compat -fno-common 
-DHAVE_CONFIG_H -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/../include
-I../../gcc/../libcpp/include -I../../gcc/../libcody -I/opt/local/include
-I/opt/local/include -I/opt/local/include  -I../../gcc/../libdecnumber
-I../../gcc/../libdecnumber/dpd -I../libdecnumber -I../../gcc/../libbacktrace 
-I/opt/local/include ../../gcc/../contrib/paranoia.cc -o paranoia.o
In file included from ../../gcc/../contrib/paranoia.cc:154:
../../gcc/hwint.h:291:7: error: use of undeclared identifier
'gcc_checking_assert'
      gcc_checking_assert (prec < HOST_BITS_PER_WIDE_INT);
      ^
../../gcc/hwint.h:314:7: error: use of undeclared identifier
'gcc_checking_assert'
      gcc_checking_assert (prec < HOST_BITS_PER_WIDE_INT);
      ^
../../gcc/hwint.h:324:3: error: use of undeclared identifier
'gcc_checking_assert'
  gcc_checking_assert (x != HOST_WIDE_INT_MIN);
  ^
../../gcc/hwint.h:361:1: error: conflicting types for 'mul_hwi'
mul_hwi (HOST_WIDE_INT a, HOST_WIDE_INT b, bool *overflow)
^
../../gcc/hwint.h:264:22: note: previous declaration is here
extern HOST_WIDE_INT mul_hwi (HOST_WIDE_INT, HOST_WIDE_INT);
                     ^
../../gcc/../contrib/paranoia.cc:172:9: warning: keyword is hidden by macro
definition [-Wkeyword-macro]
#define class klass
        ^
In file included from ../../gcc/../contrib/paranoia.cc:174:
../../gcc/real.h:181:24: error: use of undeclared identifier 'NUM_MODE_FLOAT'
  real_format_for_mode[NUM_MODE_FLOAT + NUM_MODE_DECIMAL_FLOAT];
                       ^
../../gcc/real.h:181:41: error: use of undeclared identifier
'NUM_MODE_DECIMAL_FLOAT'
  real_format_for_mode[NUM_MODE_FLOAT + NUM_MODE_DECIMAL_FLOAT];
                                        ^
../../gcc/real.h:216:1: error: unknown type name 'klass'; did you mean 'class'?
class format_helper
^~~~~
class
../../gcc/../contrib/paranoia.cc:172:15: note: expanded from macro 'class'
#define class klass
              ^
In file included from ../../gcc/../contrib/paranoia.cc:174:
../../gcc/real.h:220:3: error: templates must have C++ linkage
  template<typename T> format_helper (const T &);
  ^~~~~~~~~~~~~~~~~~~~
../../gcc/../contrib/paranoia.cc:135:3: note: extern "C" language linkage
specification begins here
  extern "C" {
  ^
In file included from ../../gcc/../contrib/paranoia.cc:174:
../../gcc/real.h:231:1: error: templates must have C++ linkage
template<typename T>
^~~~~~~~~~~~~~~~~~~~
../../gcc/../contrib/paranoia.cc:135:3: note: extern "C" language linkage
specification begins here
  extern "C" {
  ^
In file included from ../../gcc/../contrib/paranoia.cc:174:
../../gcc/real.h:233:35: error: use of undeclared identifier 'gcc_unreachable'
  : m_format (m == VOIDmode ? 0 : REAL_MODE_FORMAT (m))
                                  ^
../../gcc/real.h:189:7: note: expanded from macro 'REAL_MODE_FORMAT'
                        : (gcc_unreachable (), 0)])
                           ^
../../gcc/real.h:233:35: error: use of undeclared identifier
'MIN_MODE_DECIMAL_FLOAT'
../../gcc/real.h:185:17: note: expanded from macro 'REAL_MODE_FORMAT'
                        ? (((MODE) - MIN_MODE_DECIMAL_FLOAT)            \
                                     ^
../../gcc/real.h:233:35: error: use of undeclared identifier 'NUM_MODE_FLOAT'
../../gcc/real.h:186:9: note: expanded from macro 'REAL_MODE_FORMAT'
                           + NUM_MODE_FLOAT)                            \
                             ^
../../gcc/real.h:233:35: error: use of undeclared identifier 'MODE_FLOAT'
../../gcc/real.h:187:31: note: expanded from macro 'REAL_MODE_FORMAT'
                        : GET_MODE_CLASS (MODE) == MODE_FLOAT           \
                                                   ^
../../gcc/real.h:233:35: error: use of undeclared identifier 'MIN_MODE_FLOAT'
../../gcc/real.h:188:16: note: expanded from macro 'REAL_MODE_FORMAT'
                        ? ((MODE) - MIN_MODE_FLOAT)                     \
                                    ^
../../gcc/real.h:233:20: error: use of undeclared identifier 'VOIDmode'
  : m_format (m == VOIDmode ? 0 : REAL_MODE_FORMAT (m))
                   ^
../../gcc/real.h:243:25: error: unknown type name 'machine_mode'
extern bool HONOR_NANS (machine_mode);
                        ^
../../gcc/real.h:244:25: error: unknown type name 'const_tree'
extern bool HONOR_NANS (const_tree);
                        ^
../../gcc/real.h:245:25: error: unknown type name 'const_rtx'
extern bool HONOR_NANS (const_rtx);
                        ^
../../gcc/real.h:248:26: error: unknown type name 'machine_mode'
extern bool HONOR_SNANS (machine_mode);
                         ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
make: *** [paranoia.o] Error 1

(this is clang++ masquerading as g++ here)

git blame says the file was mostly written by Richard T. Henderson; cc-ing him.

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

* [Bug other/103487] "paranoia" Makefile target in gcc/Makefile fails to build
  2021-11-30  9:04 [Bug other/103487] New: "paranoia" Makefile target in gcc/Makefile fails to build egallager at gcc dot gnu.org
@ 2023-11-19  4:51 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-11-19  4:51 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2023-11-19
                 CC|rth at gcc dot gnu.org             |
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.

Here is the begining of the fixes, there are more that needs to be done:
```
diff --git a/contrib/paranoia.cc b/contrib/paranoia.cc
index a7821c42603..2955e3619dd 100644
--- a/contrib/paranoia.cc
+++ b/contrib/paranoia.cc
@@ -132,7 +132,6 @@ lines
      I'm doing this in C++ so that I can do operator overloading and not
      have to modify so damned much of the existing code.  */

-  extern "C" {
 #include <stdio.h>
 #include <stddef.h>
 #include <limits.h>
@@ -151,6 +150,8 @@ lines

 #include "ansidecl.h"
 #include "auto-host.h"
+#include "system.h"
+#include "coretypes.h"
 #include "hwint.h"

 #undef EXTRA_MODES_FILE
@@ -169,13 +170,8 @@ lines
     };
 #undef DEFTREECODE

-#define class klass
-
 #include "real.h"

-#undef class
-  }
-
 /* We never produce signals from the library.  Thus setjmp need do nothing. 
*/
 #undef setjmp
 #define setjmp(x)  (0)
```

real_from_integer for an example now takes signop instead of an int:
/home/apinski/src/upstream-gcc-match/gcc/gcc/../contrib/paranoia.cc:254:41:
error: invalid conversion from ‘int’ to ‘signop’ [-fpermissive]

and even the number of arguments has been changed:
/home/apinski/src/upstream-gcc-match/gcc/gcc/../contrib/paranoia.cc:254:21:
error: too many arguments to function ‘void real_from_integer(real_value*,
format_helper, const wide_int_ref&, signop)’

machine_mode is now not just an enum.

And a few others.

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

end of thread, other threads:[~2023-11-19  4:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-30  9:04 [Bug other/103487] New: "paranoia" Makefile target in gcc/Makefile fails to build egallager at gcc dot gnu.org
2023-11-19  4:51 ` [Bug other/103487] " pinskia 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).