Advertisement
Guest User

GCC 9.5.0-IRIX Patch

a guest
Feb 15th, 2025
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 306.77 KB | None | 0 0
  1. diff -Naur gcc-9.5.0/configure gcc-9.5.0-irix/configure
  2. --- gcc-9.5.0/configure 2022-05-27 03:21:10.443377000 +0000
  3. +++ gcc-9.5.0-irix/configure 2025-02-13 08:55:07.365200800 +0000
  4. @@ -3205,7 +3205,7 @@
  5. ;;
  6. *-*-netbsd* | *-*-freebsd* | *-*-openbsd* | *-*-dragonfly*)
  7. ;;
  8. - *-*-solaris2* | *-*-hpux11*)
  9. + *-*-solaris2* | *-*-hpux11* | mips*-*-irix6*)
  10. ;;
  11. *-*-darwin* | *-*-aix*)
  12. ;;
  13. diff -Naur gcc-9.5.0/configure.ac gcc-9.5.0-irix/configure.ac
  14. --- gcc-9.5.0/configure.ac 2022-05-27 03:21:10.443377000 +0000
  15. +++ gcc-9.5.0-irix/configure.ac 2025-02-13 08:55:07.385592000 +0000
  16. @@ -508,7 +508,7 @@
  17. ;;
  18. *-*-netbsd* | *-*-freebsd* | *-*-openbsd* | *-*-dragonfly*)
  19. ;;
  20. - *-*-solaris2* | *-*-hpux11*)
  21. + *-*-solaris2* | *-*-hpux11* | mips*-*-irix6*)
  22. ;;
  23. *-*-darwin* | *-*-aix*)
  24. ;;
  25. diff -Naur gcc-9.5.0/fixincludes/inclhack.def gcc-9.5.0-irix/fixincludes/inclhack.def
  26. --- gcc-9.5.0/fixincludes/inclhack.def 2022-05-27 03:21:10.455377000 +0000
  27. +++ gcc-9.5.0-irix/fixincludes/inclhack.def 2025-02-15 14:03:04.760408000 +0000
  28. @@ -20,1036 +20,6 @@
  29. FIXINC_DEBUG = yes;
  30. #endif
  31.  
  32. -/* On AIX when _LARGE_FILES is defined stdio.h defines fopen to
  33. - * fopen64 etc. and this causes problems when building with g++
  34. - * because cstdio udefs everything from stdio.h, leaving us with
  35. - * ::fopen has not been declared errors. This fixes stdio.h to
  36. - * undef those defines and use __asm__ to alias the symbols if
  37. - * building with g++ and -D_LARGE_FILES
  38. - */
  39. -fix = {
  40. - hackname = AAB_aix_stdio;
  41. - files = stdio.h;
  42. - select = "define fopen fopen64";
  43. - mach = "*-*-aix*";
  44. - test-text = ''; /* no way to test */
  45. -
  46. - c_fix = wrap;
  47. -
  48. - c_fix_arg = "";
  49. -
  50. - c_fix_arg = <<- _EOArg_
  51. -
  52. - #if defined __GNUG__ && defined _LARGE_FILES && defined __cplusplus
  53. - #define __need__aix_stdio_h_fix
  54. - #ifdef __need__aix_stdio_h_fix
  55. - #undef fseeko
  56. - #undef ftello
  57. - #undef fgetpos
  58. - #undef fsetpos
  59. - #undef fopen
  60. - #undef freopen
  61. - /* Alias the symbols using asm */
  62. - extern "C" {
  63. - extern int fgetpos(FILE *, fpos64_t *) __asm__("fgetpos64");
  64. - extern FILE *fopen(const char *, const char *) __asm__("fopen64");
  65. - extern FILE *freopen(const char *, const char *, FILE *) __asm__("freopen64");
  66. - extern int fseeko(FILE *, off64_t, int) __asm__("fseeko64");
  67. - extern int fsetpos(FILE *, const fpos64_t *) __asm__("fsetpos64");
  68. - extern off64_t ftello(FILE *) __asm__("ftello64");
  69. - }
  70. - #endif
  71. - #endif
  72. -
  73. - _EOArg_;
  74. -};
  75. -
  76. -/* On AIX when _LARGE_FILES is defined fcntl.h defines open to
  77. - * open64 and creat to creat64. This fixes fcntl.h to
  78. - * undef those defines and use __asm__ to alias the symbols if
  79. - * building with g++ and -D_LARGE_FILES
  80. - */
  81. -fix = {
  82. - hackname = AAB_aix_fcntl;
  83. - files = fcntl.h;
  84. - select = "define open[ \t]open64";
  85. - mach = "*-*-aix*";
  86. - test-text = ''; /* no way to test */
  87. -
  88. - c_fix = wrap;
  89. -
  90. - c_fix_arg = "";
  91. -
  92. - c_fix_arg = <<- _EOArg_
  93. -
  94. - #if defined __GNUG__ && defined _LARGE_FILES && defined __cplusplus
  95. - #define __need__aix_fcntl_h_fix
  96. - #ifdef __need__aix_fcntl_h_fix
  97. - #undef open
  98. - #undef creat
  99. - #undef openat
  100. - /* Alias the symbols using asm */
  101. - extern "C" {
  102. - extern int open(const char *, int, ...) __asm__("open64");
  103. - extern int creat(const char *, mode_t) __asm__("creat64");
  104. - #if (_XOPEN_SOURCE >= 700)
  105. - extern int openat(int, const char *, int, ...) __asm__("open64at");
  106. - #endif
  107. - }
  108. - #endif
  109. - #endif
  110. -
  111. - _EOArg_;
  112. -};
  113. -
  114. -/*
  115. - * On Mac OS 10.3.9, the 'long double' functions are available in
  116. - * libSystem, but are not prototyped in math.h.
  117. - */
  118. -fix = {
  119. - hackname = AAB_darwin7_9_long_double_funcs;
  120. - mach = "*-*-darwin7.9*";
  121. - files = architecture/ppc/math.h;
  122. - bypass = "powl";
  123. - replace = <<- _EndOfHeader_
  124. - /* This file prototypes the long double functions available on Mac OS
  125. - 10.3.9. */
  126. - #ifndef __MATH__
  127. - # undef __APPLE_CC__
  128. - # define __APPLE_CC__ 1345
  129. - # include_next <architecture/ppc/math.h>
  130. - # undef __APPLE_CC__
  131. - # define __APPLE_CC__ 1
  132. - # ifndef __LIBMLDBL_COMPAT
  133. - # ifdef __LONG_DOUBLE_128__
  134. - # define __LIBMLDBL_COMPAT(sym) __asm("_" #sym "$LDBL128")
  135. - # else
  136. - # define __LIBMLDBL_COMPAT(sym)
  137. - # endif /* __LONG_DOUBLE_128__ */
  138. - # endif /* __LIBMLDBL_COMPAT */
  139. - # ifdef __cplusplus
  140. - extern "C" {
  141. - # endif
  142. - extern long double acosl( long double ) __LIBMLDBL_COMPAT(acosl);
  143. - extern long double asinl( long double ) __LIBMLDBL_COMPAT(asinl);
  144. - extern long double atanl( long double ) __LIBMLDBL_COMPAT(atanl);
  145. - extern long double atan2l( long double, long double ) __LIBMLDBL_COMPAT(atan2l);
  146. - extern long double cosl( long double ) __LIBMLDBL_COMPAT(cosl);
  147. - extern long double sinl( long double ) __LIBMLDBL_COMPAT(sinl);
  148. - extern long double tanl( long double ) __LIBMLDBL_COMPAT(tanl);
  149. - extern long double acoshl( long double ) __LIBMLDBL_COMPAT(acoshl);
  150. - extern long double asinhl( long double ) __LIBMLDBL_COMPAT(asinhl);
  151. - extern long double atanhl( long double ) __LIBMLDBL_COMPAT(atanhl);
  152. - extern long double coshl( long double ) __LIBMLDBL_COMPAT(coshl);
  153. - extern long double sinhl( long double ) __LIBMLDBL_COMPAT(sinhl);
  154. - extern long double tanhl( long double ) __LIBMLDBL_COMPAT(tanhl);
  155. - extern long double expl( long double ) __LIBMLDBL_COMPAT(expl);
  156. - extern long double exp2l( long double ) __LIBMLDBL_COMPAT(exp2l);
  157. - extern long double expm1l( long double ) __LIBMLDBL_COMPAT(expm1l);
  158. - extern long double logl( long double ) __LIBMLDBL_COMPAT(logl);
  159. - extern long double log10l( long double ) __LIBMLDBL_COMPAT(log10l);
  160. - extern long double log2l( long double ) __LIBMLDBL_COMPAT(log2l);
  161. - extern long double log1pl( long double ) __LIBMLDBL_COMPAT(log1pl);
  162. - extern long double logbl( long double ) __LIBMLDBL_COMPAT(logbl);
  163. - extern long double modfl( long double, long double * ) __LIBMLDBL_COMPAT(modfl);
  164. - extern long double ldexpl( long double, int ) __LIBMLDBL_COMPAT(ldexpl);
  165. - extern long double frexpl( long double, int * ) __LIBMLDBL_COMPAT(frexpl);
  166. - extern int ilogbl( long double ) __LIBMLDBL_COMPAT(ilogbl);
  167. - extern long double scalbnl( long double, int ) __LIBMLDBL_COMPAT(scalbnl);
  168. - extern long double scalblnl( long double, long int ) __LIBMLDBL_COMPAT(scalblnl);
  169. - extern long double fabsl( long double ) __LIBMLDBL_COMPAT(fabsl);
  170. - extern long double cbrtl( long double ) __LIBMLDBL_COMPAT(cbrtl);
  171. - extern long double hypotl( long double, long double ) __LIBMLDBL_COMPAT(hypotl);
  172. - extern long double powl( long double, long double ) __LIBMLDBL_COMPAT(powl);
  173. - extern long double sqrtl( long double ) __LIBMLDBL_COMPAT(sqrtl);
  174. - extern long double erfl( long double ) __LIBMLDBL_COMPAT(erfl);
  175. - extern long double erfcl( long double ) __LIBMLDBL_COMPAT(erfcl);
  176. - extern long double lgammal( long double ) __LIBMLDBL_COMPAT(lgammal);
  177. - extern long double tgammal( long double ) __LIBMLDBL_COMPAT(tgammal);
  178. - extern long double ceill( long double ) __LIBMLDBL_COMPAT(ceill);
  179. - extern long double floorl( long double ) __LIBMLDBL_COMPAT(floorl);
  180. - extern long double nearbyintl( long double ) __LIBMLDBL_COMPAT(nearbyintl);
  181. - extern long double rintl( long double ) __LIBMLDBL_COMPAT(rintl);
  182. - extern long int lrintl( long double ) __LIBMLDBL_COMPAT(lrintl);
  183. - extern long long int llrintl( long double ) __LIBMLDBL_COMPAT(llrintl);
  184. - extern long double roundl( long double ) __LIBMLDBL_COMPAT(roundl);
  185. - extern long int lroundl( long double ) __LIBMLDBL_COMPAT(lroundl);
  186. - extern long long int llroundl( long double ) __LIBMLDBL_COMPAT(llroundl);
  187. - extern long double truncl( long double ) __LIBMLDBL_COMPAT(truncl);
  188. - extern long double fmodl( long double, long double) __LIBMLDBL_COMPAT(fmodl);
  189. - extern long double remainderl( long double, long double ) __LIBMLDBL_COMPAT(remainderl);
  190. - extern long double remquol( long double, long double, int * ) __LIBMLDBL_COMPAT(remquol);
  191. - extern long double copysignl( long double, long double ) __LIBMLDBL_COMPAT(copysignl);
  192. - extern long double nanl( const char * ) __LIBMLDBL_COMPAT(nanl);
  193. - extern long double nextafterl( long double, long double ) __LIBMLDBL_COMPAT(nextafterl);
  194. - extern long double nexttowardl( long double, long double ) __LIBMLDBL_COMPAT(nexttowardl);
  195. - extern long double fdiml( long double, long double ) __LIBMLDBL_COMPAT(fdiml);
  196. - extern long double fmaxl( long double, long double ) __LIBMLDBL_COMPAT(fmaxl);
  197. - extern long double fminl( long double, long double ) __LIBMLDBL_COMPAT(fminl);
  198. - extern long double fmal( long double, long double, long double ) __LIBMLDBL_COMPAT(fmal);
  199. - # ifdef __cplusplus
  200. - }
  201. - # endif
  202. - #endif /* __MATH__ */
  203. - _EndOfHeader_;
  204. -};
  205. -
  206. -/*
  207. - * SDKs for 10.13 and 10.14 omit the definitions for API_AVAILABLE where
  208. - * __attribute__((availability)) is not supported.
  209. - */
  210. -fix = {
  211. - hackname = darwin_api_availability;
  212. - mach = "*-*-darwin*";
  213. - files = os/availability.h;
  214. - bypass = "__IPHONE_OS_VERSION_MIN_REQUIRED";
  215. - select =
  216. - " *#define __API_AVAILABLE.*\n"
  217. - " *#define __API_DEPRECATED.*\n"
  218. - " *#define __API_DEPRECATED_WITH_REPLACEMENT.*\n"
  219. - " *#define __API_UNAVAILABLE.*\n";
  220. - c_fix = format;
  221. - c_fix_arg =
  222. - " #define API_AVAILABLE(...)\n"
  223. - " #define API_DEPRECATED(...)\n"
  224. - " #define API_DEPRECATED_WITH_REPLACEMENT(...)\n"
  225. - " #define API_UNAVAILABLE(...)\n";
  226. - test_text =
  227. - "#define __API_AVAILABLE(...)\n"
  228. - "#define __API_DEPRECATED(...)\n"
  229. - "#define __API_DEPRECATED_WITH_REPLACEMENT(...)\n"
  230. - "#define __API_UNAVAILABLE(...)\n";
  231. -};
  232. -
  233. -/*
  234. - * This fixes __FD_ZERO bug for linux 2.x.y (x <= 2 && y <= some n)
  235. - */
  236. -fix = {
  237. - hackname = AAB_fd_zero_asm_posix_types_h;
  238. - files = asm/posix_types.h;
  239. - mach = 'i[34567]86-*-linux*';
  240. - bypass = '} while';
  241. - bypass = 'x86_64';
  242. - bypass = 'posix_types_64';
  243. -
  244. - /*
  245. - * Define _POSIX_TYPES_H_WRAPPER at the end of the wrapper, not
  246. - * the start, so that if #include_next gets another instance of
  247. - * the wrapper, this will follow the #include_next chain until
  248. - * we arrive at the real <asm/posix_types.h>.
  249. - */
  250. - replace = <<- _EndOfHeader_
  251. - /* This file fixes a bug in the __FD_ZERO macro
  252. - for older versions of the Linux kernel. */
  253. - #ifndef _POSIX_TYPES_H_WRAPPER
  254. - #include <features.h>
  255. - #include_next <asm/posix_types.h>
  256. -
  257. - #if defined(__FD_ZERO) && !defined(__GLIBC__)
  258. - #undef __FD_ZERO
  259. - #define __FD_ZERO(fdsetp) \
  260. - do { \
  261. - int __d0, __d1; \
  262. - __asm__ __volatile__("cld ; rep ; stosl" \
  263. - : "=&c" (__d0), "=&D" (__d1) \
  264. - : "a" (0), "0" (__FDSET_LONGS), \
  265. - "1" ((__kernel_fd_set *) (fdsetp)) :"memory"); \
  266. - } while (0)
  267. - #endif
  268. -
  269. - #define _POSIX_TYPES_H_WRAPPER
  270. - #endif /* _POSIX_TYPES_H_WRAPPER */
  271. - _EndOfHeader_;
  272. -};
  273. -
  274. -/*
  275. - * This fixes __FD_ZERO bug for glibc-1.x
  276. - */
  277. -fix = {
  278. - hackname = AAB_fd_zero_gnu_types_h;
  279. - files = gnu/types.h;
  280. - mach = 'i[34567]86-*-linux*';
  281. -
  282. - /*
  283. - * Define _TYPES_H_WRAPPER at the end of the wrapper, not
  284. - * the start, so that if #include_next gets another instance of
  285. - * the wrapper, this will follow the #include_next chain until
  286. - * we arrive at the real <gnu/types.h>.
  287. - */
  288. - replace = <<- _EndOfHeader_
  289. - /* This file fixes a bug in the __FD_ZERO macro present in glibc 1.x. */
  290. - #ifndef _TYPES_H_WRAPPER
  291. - #include <features.h>
  292. - #include_next <gnu/types.h>
  293. -
  294. - #if defined(__FD_ZERO) && !defined(__GLIBC__)
  295. - #undef __FD_ZERO
  296. - # define __FD_ZERO(fdsetp) \
  297. - do { \
  298. - int __d0, __d1; \
  299. - __asm__ __volatile__("cld ; rep ; stosl" \
  300. - : "=&c" (__d0), "=&D" (__d1) \
  301. - : "a" (0), "0" (__FDSET_LONGS), \
  302. - "1" ((__fd_set *) (fdsetp)) :"memory"); \
  303. - } while (0)
  304. - #endif
  305. -
  306. - #define _TYPES_H_WRAPPER
  307. - #endif /* _TYPES_H_WRAPPER */
  308. - _EndOfHeader_;
  309. -};
  310. -
  311. -/*
  312. - * This fixes __FD_ZERO bug for glibc-2.0.x
  313. - */
  314. -fix = {
  315. - hackname = AAB_fd_zero_selectbits_h;
  316. - files = selectbits.h;
  317. - mach = 'i[34567]86-*-linux*';
  318. -
  319. - /*
  320. - * Define _SELECTBITS_H_WRAPPER at the end of the wrapper, not
  321. - * the start, so that if #include_next gets another instance of
  322. - * the wrapper, this will follow the #include_next chain until
  323. - * we arrive at the real <selectbits.h>.
  324. - */
  325. - replace = <<- _EndOfHeader_
  326. - /* This file fixes a bug in the __FD_ZERO macro present in glibc 2.0.x. */
  327. - #ifndef _SELECTBITS_H_WRAPPER
  328. - #include <features.h>
  329. - #include_next <selectbits.h>
  330. -
  331. - #if defined(__FD_ZERO) && defined(__GLIBC__) \\
  332. - && defined(__GLIBC_MINOR__) && __GLIBC__ == 2 \\
  333. - && __GLIBC_MINOR__ == 0
  334. - #undef __FD_ZERO
  335. - #define __FD_ZERO(fdsetp) \\
  336. - do { \\
  337. - int __d0, __d1; \\
  338. - __asm__ __volatile__ ("cld; rep; stosl" \\
  339. - : "=&c" (__d0), "=&D" (__d1) \\
  340. - : "a" (0), "0" (sizeof (__fd_set) \\
  341. - / sizeof (__fd_mask)), \\
  342. - "1" ((__fd_mask *) (fdsetp)) \\
  343. - : "memory"); \\
  344. - } while (0)
  345. - #endif
  346. -
  347. - #define _SELECTBITS_H_WRAPPER
  348. - #endif /* _SELECTBITS_H_WRAPPER */
  349. - _EndOfHeader_;
  350. -};
  351. -
  352. -/*
  353. - * Solaris <sys/varargs.h> is a DDK (aka kernel-land) header providing
  354. - * the same interface as <stdarg.h>. No idea why they couldn't have just
  355. - * used the standard header.
  356. - */
  357. -fix = {
  358. - hackname = AAB_solaris_sys_varargs_h;
  359. - files = "sys/varargs.h";
  360. - mach = '*-*-solaris*';
  361. - replace = <<- _EndOfHeader_
  362. - #ifdef __STDC__
  363. - #include <stdarg.h>
  364. - #else
  365. - #include <varargs.h>
  366. - #endif
  367. - _EndOfHeader_;
  368. -};
  369. -
  370. -/*
  371. - * Fix non-ANSI memcpy declaration that conflicts with gcc's builtin
  372. - * declaration on Sun OS 4.x. We must only fix this on Sun OS 4.x, because
  373. - * many other systems have similar text but correct versions of the file.
  374. - * To ensure only Sun's is fixed, we grep for a likely unique string.
  375. - * Fix also on sysV68 R3V7.1 (head/memory.h\t50.1\t )
  376. - */
  377. -fix = {
  378. - hackname = AAB_sun_memcpy;
  379. - files = memory.h;
  380. - select = "/\\*\t@\\(#\\)"
  381. - "(head/memory.h\t50.1\t "
  382. - "|memory\\.h 1\\.[2-4] 8./../.. SMI; from S5R2 1\\.2\t)\\*/";
  383. -
  384. - replace = <<- _EndOfHeader_
  385. - /* This file was generated by fixincludes */
  386. - #ifndef __memory_h__
  387. - #define __memory_h__
  388. -
  389. - #ifdef __STDC__
  390. - extern void *memccpy();
  391. - extern void *memchr();
  392. - extern void *memcpy();
  393. - extern void *memset();
  394. - #else
  395. - extern char *memccpy();
  396. - extern char *memchr();
  397. - extern char *memcpy();
  398. - extern char *memset();
  399. - #endif /* __STDC__ */
  400. -
  401. - extern int memcmp();
  402. -
  403. - #endif /* __memory_h__ */
  404. - _EndOfHeader_;
  405. -};
  406. -
  407. -/*
  408. - * Fix assert.h on VxWorks:
  409. - */
  410. -fix = {
  411. - hackname = AAB_vxworks_assert;
  412. - files = assert.h;
  413. - mach = "*-*-vxworks*";
  414. -
  415. - replace = <<- _EndOfHeader_
  416. - #ifdef _ASSERT_H
  417. - #undef _ASSERT_H
  418. - #undef assert
  419. - #endif
  420. -
  421. - #define _ASSERT_H
  422. -
  423. - #ifdef __cplusplus
  424. - extern "C" {
  425. - #endif
  426. -
  427. - #if defined(__STDC__) || defined(__cplusplus)
  428. - extern void __assert (const char*);
  429. - #else
  430. - extern void __assert ();
  431. - #endif
  432. -
  433. - #ifdef NDEBUG
  434. - #define assert(ign) ((void)0)
  435. - #else
  436. -
  437. - #define ASSERT_STRINGIFY(str) ASSERT_STRINGIFY_HELPER(str)
  438. - #define ASSERT_STRINGIFY_HELPER(str) #str
  439. -
  440. - #define assert(test) ((void) \
  441. - ((test) ? ((void)0) : \
  442. - __assert("Assertion failed: " #test ", file " \
  443. - __FILE__ ", line " ASSERT_STRINGIFY(__LINE__) "\n")))
  444. -
  445. - #endif
  446. -
  447. - #ifdef __cplusplus
  448. - }
  449. - #endif
  450. - _EndOfHeader_;
  451. -};
  452. -
  453. -/*
  454. - * Add needed include to regs.h (NOT the gcc header) on VxWorks
  455. - */
  456. -
  457. -fix = {
  458. - hackname = AAB_vxworks_regs_vxtypes;
  459. - files = regs.h;
  460. - mach = "*-*-vxworks*";
  461. -
  462. - replace = <<- _EndOfHeader_
  463. - #ifndef _REGS_H
  464. - #define _REGS_H
  465. - /* regs.h depends on CPU_FAMILY being properly defined, which
  466. - is done by vxCpu.h. */
  467. - #include <types/vxCpu.h>
  468. - /* regs.h includes a CPU_FAMILY-specific header that requires
  469. - vxTypesOld.h to already have been included. Those headers
  470. - contain proper _ASMLANGUAGE guards around their typedefs,
  471. - but vxTypesOld.h itself does not. So we avoid including
  472. - vxTypesOld.h from assembly. */
  473. - #ifndef _ASMLANGUAGE
  474. - #include <types/vxTypesOld.h>
  475. - #endif
  476. - #include_next <arch/../regs.h>
  477. - #endif
  478. - _EndOfHeader_;
  479. -};
  480. -
  481. -/*
  482. - * This hack makes makes unistd.h more POSIX-compliant on VxWorks
  483. - */
  484. -fix = {
  485. - hackname = AAB_vxworks_unistd;
  486. - files = unistd.h;
  487. - mach = "*-*-vxworks*";
  488. -
  489. - replace = <<- _EndOfHeader_
  490. - #ifndef _UNISTD_H
  491. - #define _UNISTD_H
  492. - #include_next <unistd.h>
  493. - #include <ioLib.h>
  494. - #ifndef STDIN_FILENO
  495. - #define STDIN_FILENO 0
  496. - #endif
  497. - #ifndef STDOUT_FILENO
  498. - #define STDOUT_FILENO 1
  499. - #endif
  500. - #ifndef STDERR_FILENO
  501. - #define STDERR_FILENO 2
  502. - #endif
  503. - #endif /* _UNISTD_H */
  504. - _EndOfHeader_;
  505. -};
  506. -
  507. -/*
  508. - * assert.h on AIX 7 redefines static_assert as _Static_assert without
  509. - * protecting C++.
  510. - */
  511. -fix = {
  512. - hackname = aix_assert;
  513. - mach = "*-*-aix*";
  514. - files = assert.h;
  515. - select = "#define[ \t]static_assert[ \t]_Static_assert";
  516. - c_fix = format;
  517. - c_fix_arg = "#ifndef __cplusplus\n%0\n#endif";
  518. - test_text = "#define static_assert _Static_assert";
  519. -};
  520. -
  521. -/*
  522. - * complex.h on AIX 5 and AIX 6 define _Complex_I and I in terms of __I,
  523. - * which only is provided by AIX xlc C99.
  524. - */
  525. -fix = {
  526. - hackname = aix_complex;
  527. - mach = "*-*-aix*";
  528. - files = complex.h;
  529. - select = "#define[ \t]_Complex_I[ \t]__I";
  530. - c_fix = format;
  531. - c_fix_arg = "#define _Complex_I (__extension__ 1.0iF)";
  532. - test_text = "#define _Complex_I __I\n";
  533. -};
  534. -
  535. -/*
  536. - * On AIX some headers are not properly guarded by 'extern "C"'.
  537. - */
  538. -fix = {
  539. - hackname = aix_externc;
  540. - mach = "*-*-aix*";
  541. - files = ctype.h;
  542. - files = fcntl.h;
  543. - files = langinfo.h;
  544. - files = ldfcn.h;
  545. - files = sys/localedef.h;
  546. - files = sys/times.h;
  547. - bypass = "extern \"C\"";
  548. - c_fix = wrap;
  549. - c_fix_arg = "#ifdef __cplusplus\n"
  550. - "extern \"C\" {\n"
  551. - "#endif\n";
  552. - c_fix_arg = "#ifdef __cplusplus\n"
  553. - "}\n"
  554. - "#endif\n";
  555. - test_text = "extern int __n_pthreads;\n";
  556. -};
  557. -
  558. -/*
  559. - * On AIX sys/socket.h assumes C++.
  560. - */
  561. -fix = {
  562. - hackname = aix_externcpp1;
  563. - mach = "*-*-aix*";
  564. - files = "sys/socket.h";
  565. - select = "#ifdef __cplusplus";
  566. - c_fix = format;
  567. - c_fix_arg = "#ifdef __cplusplus\n"
  568. - "extern \"C++\" {";
  569. - test_text = "#ifdef __cplusplus";
  570. -
  571. -};
  572. -
  573. -fix = {
  574. - hackname = aix_externcpp2;
  575. - mach = "*-*-aix*";
  576. - files = "sys/socket.h";
  577. - select = "#else /\\* __cplusplus \\*/";
  578. - c_fix = format;
  579. - c_fix_arg = "} /* extern \"C++\" */\n"
  580. - "#else /* __cplusplus */";
  581. - test_text = "#else /* __cplusplus */";
  582. -
  583. -};
  584. -
  585. -/*
  586. - * malloc.h on AIX6 uses XLC++ specific builtin syntax
  587. - */
  588. -fix = {
  589. - hackname = aix_malloc;
  590. - mach = "*-*-aix*";
  591. - files = "malloc.h";
  592. - select = "#ifdef __cplusplus";
  593. - c_fix = format;
  594. - c_fix_arg = "#if (defined(__cplusplus) && defined(__IBMCPP__))";
  595. - test_text = "#ifdef __cplusplus";
  596. -};
  597. -
  598. -/*
  599. - * net/if_arp.h defines a variable fc_softc instead of adding a
  600. - * typedef for the struct on AIX 5.2, 5.3, 6.1 and 7.1
  601. - */
  602. -fix = {
  603. - hackname = aix_net_if_arp;
  604. - mach = "*-*-aix*";
  605. - files = "net/if_arp.h";
  606. - select = "^struct fc_softc \\{";
  607. - c_fix = format;
  608. - c_fix_arg = "typedef struct _fc_softc {";
  609. - test_text = "struct fc_softc {\n int a;\n};";
  610. -};
  611. -
  612. -/*
  613. - * Fix AIX definition of NULL for G++.
  614. - */
  615. -fix = {
  616. - hackname = aix_null;
  617. - mach = "*-*-aix*";
  618. - files = curses.h, dbm.h, locale.h, stdio.h, stdlib.h, string.h,
  619. - time.h, unistd.h, wchar.h, sys/dir.h, sys/param.h, sys/types.h;
  620. - bypass = __null;
  621. - select = "#define[ \t]+NULL[ \t]+\\(*0L*\\)*";
  622. - c_fix = format;
  623. - c_fix_arg = <<- _EOFix_
  624. - #ifndef NULL
  625. - #ifdef __cplusplus
  626. - #ifdef __GNUG__
  627. - #define NULL __null
  628. - #else /* ! __GNUG__ */
  629. - #define NULL 0L
  630. - #endif /* __GNUG__ */
  631. - #else /* ! __cplusplus */
  632. - #define NULL ((void *)0)
  633. - #endif /* __cplusplus */
  634. - #endif /* !NULL */
  635. - _EOFix_;
  636. - test_text = "# define\tNULL \t(0L) /* typed NULL */";
  637. -};
  638. -
  639. -/*
  640. - * pthread.h on AIX defines PTHREAD_ONCE_INIT, PTHREAD_MUTEX_INITIALIZER,
  641. - * PTHREAD_COND_INITIALIZER and PTHREAD_RWLOCK_INITIALIZER without enough
  642. - * braces.
  643. - */
  644. -fix = {
  645. - hackname = aix_once_init_1;
  646. - mach = "*-*-aix*";
  647. - files = "pthread.h";
  648. - select = "#define[ \t]PTHREAD_ONCE_INIT \\\\\n"
  649. - "\\{ \\\\\n";
  650. - c_fix = format;
  651. - c_fix_arg = "#define PTHREAD_ONCE_INIT \\\n"
  652. - "{{ \\\n";
  653. - test_text = "#define PTHREAD_ONCE_INIT \\\\\n"
  654. - "{ \\\\\n";
  655. -};
  656. -
  657. -fix = {
  658. - hackname = aix_once_init_2;
  659. - mach = "*-*-aix*";
  660. - files = "pthread.h";
  661. - select = "[ \t]0 \\\\\n"
  662. - "\\}\n";
  663. - c_fix = format;
  664. - c_fix_arg = " 0 \\\n"
  665. - "}}\n";
  666. - test_text = " 0 \\\\\n"
  667. - "}\n";
  668. -};
  669. -
  670. -fix = {
  671. - hackname = aix_mutex_initializer_1;
  672. - mach = "*-*-aix*";
  673. - files = "pthread.h";
  674. - select = "#define[ \t]PTHREAD_MUTEX_INITIALIZER \\\\\n"
  675. - "\\{ \\\\\n";
  676. - c_fix = format;
  677. - c_fix_arg = "#define PTHREAD_MUTEX_INITIALIZER \\\n"
  678. - "{{ \\\n";
  679. - test_text = "#define PTHREAD_MUTEX_INITIALIZER \\\\\n"
  680. - "{ \\\\\n";
  681. -};
  682. -
  683. -fix = {
  684. - hackname = aix_cond_initializer_1;
  685. - mach = "*-*-aix*";
  686. - files = "pthread.h";
  687. - select = "#define[ \t]PTHREAD_COND_INITIALIZER \\\\\n"
  688. - "\\{ \\\\\n";
  689. - c_fix = format;
  690. - c_fix_arg = "#define PTHREAD_COND_INITIALIZER \\\n"
  691. - "{{ \\\n";
  692. - test_text = "#define PTHREAD_COND_INITIALIZER \\\\\n"
  693. - "{ \\\\\n";
  694. -};
  695. -
  696. -fix = {
  697. - hackname = aix_rwlock_initializer_1;
  698. - mach = "*-*-aix*";
  699. - files = "pthread.h";
  700. - select = "#define[ \t]PTHREAD_RWLOCK_INITIALIZER \\\\\n"
  701. - "\\{ \\\\\n";
  702. - c_fix = format;
  703. - c_fix_arg = "#define PTHREAD_RWLOCK_INITIALIZER \\\n"
  704. - "{{ \\\n";
  705. - test_text = "#define PTHREAD_RWLOCK_INITIALIZER \\\\\n"
  706. - "{ \\\\\n";
  707. -};
  708. -
  709. -/*
  710. - * pthread.h on AIX 4.3.3 tries to define a macro without whitspace
  711. - * which violates a requirement of ISO C.
  712. - */
  713. -fix = {
  714. - hackname = aix_pthread;
  715. - files = "pthread.h";
  716. - select = "(#define[\t ][A-Za-z_0-9]+)(\\\\\n[^A-Za-z_0-9 \t\n(])";
  717. - c_fix = format;
  718. - c_fix_arg = "%1 %2";
  719. - test_text = "#define PTHREAD_MUTEX_INITIALIZER\\\\\n"
  720. - "{...init stuff...}";
  721. -};
  722. -
  723. -/*
  724. - * AIX stdint.h fixes.
  725. - */
  726. -fix = {
  727. - hackname = aix_stdint_1;
  728. - mach = "*-*-aix*";
  729. - files = stdint-aix.h, stdint.h;
  730. - select = "#define[ \t]UINT8_MAX[ \t]\\(255U\\)\n"
  731. - "#define[ \t]UINT16_MAX[ \t]\\(65535U\\)";
  732. - c_fix = format;
  733. - c_fix_arg = "#define UINT8_MAX (255)\n"
  734. - "#define UINT16_MAX (65535)";
  735. - test_text = "#define UINT8_MAX (255U)\n"
  736. - "#define UINT16_MAX (65535U)";
  737. -};
  738. -
  739. -/*
  740. - * aix_stdint_2
  741. - */
  742. -fix = {
  743. - hackname = aix_stdint_2;
  744. - mach = "*-*-aix*";
  745. - files = stdint-aix.h, stdint.h;
  746. - select = "#define[ \t]INTPTR_MIN[ \t]INT64_MIN\n"
  747. - "#define[ \t]INTPTR_MAX[ \t]INT64_MAX\n"
  748. - "#define[ \t]UINTPTR_MAX[ \t]UINT64_MAX\n"
  749. - "#else\n"
  750. - "#define[ \t]INTPTR_MIN[ \t]INT32_MIN\n"
  751. - "#define[ \t]INTPTR_MAX[ \t]INT32_MAX\n"
  752. - "#define[ \t]UINTPTR_MAX[ \t]UINT32_MAX";
  753. - c_fix = format;
  754. - c_fix_arg = "#define INTPTR_MIN (-INTPTR_MAX-1)\n"
  755. - "#define INTPTR_MAX 9223372036854775807L\n"
  756. - "#define UINTPTR_MAX 18446744073709551615UL\n"
  757. - "#else\n"
  758. - "#define INTPTR_MIN (-INTPTR_MAX-1)\n"
  759. - "#define INTPTR_MAX 2147483647L\n"
  760. - "#define UINTPTR_MAX 4294967295UL";
  761. - test_text = "#define INTPTR_MIN INT64_MIN\n"
  762. - "#define INTPTR_MAX INT64_MAX\n"
  763. - "#define UINTPTR_MAX UINT64_MAX\n"
  764. - "#else\n"
  765. - "#define INTPTR_MIN INT32_MIN\n"
  766. - "#define INTPTR_MAX INT32_MAX\n"
  767. - "#define UINTPTR_MAX UINT32_MAX";
  768. -};
  769. -
  770. -/*
  771. - * aix_stdint_3
  772. - */
  773. -fix = {
  774. - hackname = aix_stdint_3;
  775. - mach = "*-*-aix*";
  776. - files = stdint-aix.h, stdint.h;
  777. - select = "#define[ \t]PTRDIFF_MIN[ \t]INT64_MIN\n"
  778. - "#define[ \t]PTRDIFF_MAX[ \t]INT64_MAX\n"
  779. - "#else\n"
  780. - "#define[ \t]PTRDIFF_MIN[ \t]*INT32_MIN\n"
  781. - "#define[ \t]PTRDIFF_MAX[ \t]*INT32_MAX";
  782. - c_fix = format;
  783. - c_fix_arg = "#define PTRDIFF_MIN (-9223372036854775807L - 1)\n"
  784. - "#define PTRDIFF_MAX 9223372036854775807L\n"
  785. - "#else\n"
  786. - "#define PTRDIFF_MIN (-2147483647L - 1)\n"
  787. - "#define PTRDIFF_MAX 2147483647L";
  788. - test_text = "#define PTRDIFF_MIN INT64_MIN\n"
  789. - "#define PTRDIFF_MAX INT64_MAX\n"
  790. - "#else\n"
  791. - "#define PTRDIFF_MIN INT32_MIN\n"
  792. - "#define PTRDIFF_MAX INT32_MAX";
  793. -};
  794. -
  795. -/*
  796. - * aix_stdint_4
  797. - */
  798. -fix = {
  799. - hackname = aix_stdint_4;
  800. - mach = "*-*-aix*";
  801. - files = stdint-aix.h, stdint.h;
  802. - select = "#define[ \t]SIZE_MAX[ \t]UINT64_MAX\n"
  803. - "#else\n"
  804. - "#define[ \t]SIZE_MAX[ \t]*UINT32_MAX";
  805. - c_fix = format;
  806. - c_fix_arg = "#define SIZE_MAX 18446744073709551615UL\n"
  807. - "#else\n"
  808. - "#define SIZE_MAX 4294967295UL";
  809. - test_text = "#define SIZE_MAX UINT64_MAX\n"
  810. - "#else\n"
  811. - "#define SIZE_MAX UINT32_MAX";
  812. -};
  813. -
  814. -/*
  815. - * aix_stdint_5
  816. - */
  817. -fix = {
  818. - hackname = aix_stdint_5;
  819. - mach = "*-*-aix*";
  820. - files = stdint-aix.h, stdint.h;
  821. - select = "#define[ \t]UINT8_C\\(c\\)[ \t]__CONCAT__\\(c,U\\)\n"
  822. - "#define[ \t]UINT16_C\\(c\\)[ \t]__CONCAT__\\(c,U\\)";
  823. - c_fix = format;
  824. - c_fix_arg = "#define UINT8_C(c) c\n"
  825. - "#define UINT16_C(c) c";
  826. - test_text = "#define UINT8_C(c) __CONCAT__(c,U)\n"
  827. - "#define UINT16_C(c) __CONCAT__(c,U)";
  828. -};
  829. -
  830. -/*
  831. - * stdio.h on AIX defines ferror, clearerr and feof as C++ inline, which
  832. - produces wrong code with G++.
  833. - */
  834. -fix = {
  835. - hackname = aix_stdio_inline;
  836. - mach = "*-*-aix*";
  837. - files = stdio.h;
  838. - select = "#ifdef __cplusplus\\\n"
  839. - "}\\\n\\\n"
  840. - "#ifdef ferror\\\n";
  841. - c_fix = format;
  842. - c_fix_arg = "#ifdef __cplusplus\n"
  843. - "}\n"
  844. - "#endif\n\n"
  845. - "#if (defined(__cplusplus) && defined(__IBMCPP__))\n"
  846. - "#ifdef ferror\n";
  847. - test_text = "#ifdef __cplusplus\n}\n\n#ifdef ferror";
  848. -};
  849. -
  850. -/*
  851. - * stdlib.h on AIX uses #define on malloc and friends.
  852. - */
  853. -fix = {
  854. - hackname = aix_stdlib_malloc;
  855. - mach = "*-*-aix*";
  856. - files = stdlib.h;
  857. - select = "#define[ \t]+malloc[ \t]+__linux_malloc";
  858. - c_fix = format;
  859. - c_fix_arg = "extern void *malloc(size_t) __asm__(\"__linux_malloc\");";
  860. - test_text = "#define malloc __linux_malloc";
  861. -};
  862. -
  863. -fix = {
  864. - hackname = aix_stdlib_realloc;
  865. - mach = "*-*-aix*";
  866. - files = stdlib.h;
  867. - select = "#define[ \t]+realloc[ \t]+__linux_realloc";
  868. - c_fix = format;
  869. - c_fix_arg = "extern void *realloc(void *, size_t) __asm__(\"__linux_realloc\");";
  870. - test_text = "#define realloc __linux_realloc";
  871. -};
  872. -
  873. -fix = {
  874. - hackname = aix_stdlib_calloc;
  875. - mach = "*-*-aix*";
  876. - files = stdlib.h;
  877. - select = "#define[ \t]+calloc[ \t]+__linux_calloc";
  878. - c_fix = format;
  879. - c_fix_arg = "extern void *calloc(size_t, size_t) __asm__(\"__linux_calloc\");";
  880. - test_text = "#define calloc __linux_calloc";
  881. -};
  882. -
  883. -fix = {
  884. - hackname = aix_stdlib_valloc;
  885. - mach = "*-*-aix*";
  886. - files = stdlib.h;
  887. - select = "#define[ \t]+valloc[ \t]+__linux_valloc";
  888. - c_fix = format;
  889. - c_fix_arg = "extern void *valloc(size_t) __asm__(\"__linux_valloc\");";
  890. - test_text = "#define valloc __linux_valloc";
  891. -};
  892. -
  893. -fix = {
  894. - hackname = aix_stdlib_vec_malloc;
  895. - mach = "*-*-aix*";
  896. - files = stdlib.h;
  897. - select = "#define[ \t]+malloc[ \t]+vec_malloc";
  898. - c_fix = format;
  899. - c_fix_arg = "extern void *malloc(size_t) __asm__(\"vec_malloc\");";
  900. - test_text = "#define malloc vec_malloc";
  901. -};
  902. -
  903. -fix = {
  904. - hackname = aix_stdlib_vec_calloc;
  905. - mach = "*-*-aix*";
  906. - files = stdlib.h;
  907. - select = "#define[ \t]+calloc[ \t]+vec_calloc";
  908. - c_fix = format;
  909. - c_fix_arg = "extern void *calloc(size_t, size_t) __asm__(\"vec_calloc\");";
  910. - test_text = "#define calloc vec_calloc";
  911. -};
  912. -
  913. -/*
  914. - * stdlib.h on AIX 4.3 declares strtof() with a non-const first argument.
  915. - */
  916. -fix = {
  917. - hackname = aix_strtof_const;
  918. - mach = "*-*-aix*";
  919. - files = stdlib.h;
  920. - select = "((extern[ \t]+)?float[ \t]+strtof)\\(char \\*, char \\*\\*\\);";
  921. - c_fix = format;
  922. - c_fix_arg = "%1(const char *, char **);";
  923. - test_text = "extern float strtof(char *, char **);";
  924. -};
  925. -
  926. -/*
  927. - * sys/machine.h on AIX 4.3.3 puts whitespace between a \ and a newline
  928. - * in an otherwise harmless (and #ifed out) macro definition
  929. - */
  930. -fix = {
  931. - hackname = aix_sysmachine;
  932. - mach = "*-*-aix*";
  933. - files = sys/machine.h;
  934. - select = "\\\\ +\n";
  935. - c_fix = format;
  936. - c_fix_arg = "\\\n";
  937. - test_text = "#define FOO \\\n"
  938. - " bar \\ \n baz \\ \n bat";
  939. -};
  940. -
  941. -/*
  942. - * sys/wait.h on AIX 5.2 defines macros that have both signed and
  943. - * unsigned types in conditional expressions.
  944. - */
  945. -fix = {
  946. - hackname = aix_syswait_2;
  947. - mach = "*-*-aix*";
  948. - files = sys/wait.h;
  949. - select = '\? (\(\(\(\(unsigned[^)]*\)[^)]*\) >> [^)]*\) \& 0xff\) : -1)';
  950. - c_fix = format;
  951. - c_fix_arg = "? (int)%1";
  952. - test_text = "#define WSTOPSIG(__x) "
  953. - "(int)(WIFSTOPPED(__x) ? ((((unsigned int)__x) >> 8) & 0xff) : -1)";
  954. -};
  955. -
  956. -/*
  957. - * sys/signal.h on some versions of AIX uses volatile in the typedef of
  958. - * sig_atomic_t, which causes gcc to generate a warning about duplicate
  959. - * volatile when a sig_atomic_t variable is declared volatile, as
  960. - * required by ANSI C.
  961. - */
  962. -fix = {
  963. - hackname = aix_volatile;
  964. - mach = "*-*-aix*";
  965. - files = sys/signal.h;
  966. - select = "typedef volatile int sig_atomic_t";
  967. - c_fix = format;
  968. - c_fix_arg = "typedef int sig_atomic_t";
  969. - test_text = "typedef volatile int sig_atomic_t;";
  970. -};
  971. -
  972. -/*
  973. - * AIX unistd.h defines a static function with an empty parameter list.
  974. - */
  975. -fix = {
  976. - hackname = aix_unistd;
  977. - mach = "*-*-aix*";
  978. - files = unistd.h;
  979. -
  980. - select = "[ \t]+static[ \t]+int[ \t]+getdtablesize\\(\\)";
  981. - c_fix = format;
  982. - c_fix_arg = "\tstatic int\t\tgetdtablesize(void)";
  983. - test_text = " static int getdtablesize()";
  984. -};
  985. -
  986. -/*
  987. - * Fix __assert declaration in assert.h on Alpha OSF/1.
  988. - */
  989. -fix = {
  990. - hackname = alpha___assert;
  991. - files = "assert.h";
  992. - select = '__assert\(char \*, char \*, int\)';
  993. - c_fix = format;
  994. - c_fix_arg = "__assert(const char *, const char *, int)";
  995. - test_text = 'extern void __assert(char *, char *, int);';
  996. -};
  997. -
  998. -/*
  999. - * Fix assert macro in assert.h on Alpha OSF/1.
  1000. - * The superfluous int cast breaks C++.
  1001. - */
  1002. -fix = {
  1003. - hackname = alpha_assert;
  1004. - files = "assert.h";
  1005. - select = "(#[ \t]*" 'define assert\(EX\).*)\(\(int\) \(EX\)\)';
  1006. - c_fix = format;
  1007. - c_fix_arg = "%1(EX)";
  1008. - test_text = '#define assert(EX) (((int) (EX)) ? (void)0 '
  1009. - ': __assert(#EX, __FILE__, __LINE__))';
  1010. -};
  1011. -
  1012. -/*
  1013. - * Fix getopt declarations in stdio.h and stdlib.h on Alpha OSF/1 and AIX.
  1014. - */
  1015. -fix = {
  1016. - hackname = alpha_getopt;
  1017. - files = "stdio.h";
  1018. - files = "stdlib.h";
  1019. - select = 'getopt\(int, char \*\[\], *char \*\)';
  1020. - c_fix = format;
  1021. - c_fix_arg = "getopt(int, char *const[], const char *)";
  1022. - test_text = 'extern int getopt(int, char *[], char *);';
  1023. -};
  1024. -
  1025. -/*
  1026. - * Fix missing semicolon on Alpha OSF/4 in <net/if.h>
  1027. - */
  1028. -fix = {
  1029. - hackname = alpha_if_semicolon;
  1030. - files = net/if.h;
  1031. - select = "struct[ \t]+sockaddr[ \t]+vmif_paddr[ \t]+/\\*";
  1032. - c_fix = format;
  1033. - c_fix_arg = "struct sockaddr vmif_paddr;\t/*";
  1034. - test_text = ' struct sockaddr vmif_paddr /* protocol address */';
  1035. -};
  1036. -
  1037. -/*
  1038. - * Remove erroneous parentheses in sym.h on Alpha OSF/1.
  1039. - */
  1040. -fix = {
  1041. - hackname = alpha_parens;
  1042. - files = sym.h;
  1043. - select = '#ifndef\(__mips64\)';
  1044. - c_fix = format;
  1045. - c_fix_arg = "#ifndef __mips64";
  1046. - test_text = "#ifndef(__mips64) /* bogus */\nextern int foo;\n#endif";
  1047. -};
  1048. -
  1049. -/*
  1050. - * Fix return value of sbrk in unistd.h on Alpha OSF/1 V2.0
  1051. - * And OpenBSD.
  1052. - */
  1053. -fix = {
  1054. - hackname = alpha_sbrk;
  1055. - files = unistd.h;
  1056. - select = "char[ \t]*\\*[\t ]*sbrk[ \t]*\\(";
  1057. - c_fix = format;
  1058. - c_fix_arg = "void *sbrk(";
  1059. - test_text = "extern char* sbrk(ptrdiff_t increment);";
  1060. -};
  1061. -
  1062. /*
  1063. * For C++, avoid any typedef or macro definition of bool,
  1064. * and use the built in type instead.
  1065. @@ -1190,25 +160,6 @@
  1066. "extern double cabs ( _Complex z );";
  1067. };
  1068.  
  1069. -/*
  1070. - * Fixup Darwin's broken check for __builtin_nanf.
  1071. - */
  1072. -fix = {
  1073. - hackname = broken_nan;
  1074. - /*
  1075. - * It is tempting to omit the first "files" entry. Do not.
  1076. - * The testing machinery will take the first "files" entry as the name
  1077. - * of a test file to play with. It would be a nuisance to have a directory
  1078. - * with the name "*".
  1079. - */
  1080. - files = "architecture/ppc/math.h";
  1081. - files = "architecture/*/math.h";
  1082. - select = '#if defined\(__APPLE_CC__\) && \(__APPLE_CC__ >= 1345\)';
  1083. - bypass = "powl";
  1084. - c_fix = format;
  1085. - c_fix_arg = "#if 1";
  1086. - test_text = "#if defined(__APPLE_CC__) && (__APPLE_CC__ >= 1345)";
  1087. -};
  1088.  
  1089. /*
  1090. * Various systems derived from BSD4.4 contain a macro definition
  1091. @@ -1299,1605 +250,6 @@
  1092. };
  1093.  
  1094. /*
  1095. - * macOS 10.12 <AvailabilityInternal.h> uses __attribute__((availability))
  1096. - * unconditionally.
  1097. - */
  1098. -fix = {
  1099. - hackname = darwin_availabilityinternal;
  1100. - mach = "*-*-darwin*";
  1101. - files = AvailabilityInternal.h;
  1102. - select = "#define[ \t]+(__API_[ADU]\\([^)]*\\)).*";
  1103. - c_fix = format;
  1104. - c_fix_arg = <<- _EOFix_
  1105. - #if defined(__has_attribute)
  1106. - #if __has_attribute(availability)
  1107. - %0
  1108. - #else
  1109. - #define %1
  1110. - #endif
  1111. - #else
  1112. - #define %1
  1113. - #endif
  1114. - _EOFix_;
  1115. -
  1116. - test_text = "#define __API_A(x) __attribute__((availability(__API_AVAILABLE_PLATFORM_##x)))\n"
  1117. - "#define __API_D(msg,x) __attribute__((availability(__API_DEPRECATED_PLATFORM_##x,message=msg)))";
  1118. -};
  1119. -
  1120. -/*
  1121. - * For the AAB_darwin7_9_long_double_funcs fix (and later fixes for long long)
  1122. - * to be useful, the main math.h must use <> and not "" includes.
  1123. - */
  1124. -fix = {
  1125. - hackname = darwin_9_long_double_funcs_2;
  1126. - mach = "*-*-darwin*";
  1127. - files = math.h;
  1128. - select = '#include[ \t]+\"';
  1129. - c_fix = format;
  1130. - c_fix_arg = "%1<%2.h>";
  1131. -
  1132. - c_fix_arg = '([ \t]*#[ \t]*include[ \t]+)"([a-z0-9/]+)\.h"';
  1133. -
  1134. - test_text = '#include <architecture/ppc/math.h>';
  1135. -};
  1136. -
  1137. -/*
  1138. - * On darwin8 and earlier, mach-o/swap.h isn't properly guarded
  1139. - * by 'extern "C"'. On darwin7 some mach/ headers aren't properly guarded.
  1140. - */
  1141. -fix = {
  1142. - hackname = darwin_externc;
  1143. - mach = "*-*-darwin*";
  1144. - files = mach-o/swap.h;
  1145. - files = mach/mach_time.h;
  1146. - files = mach/mach_traps.h;
  1147. - files = mach/message.h;
  1148. - files = mach/mig.h;
  1149. - files = mach/semaphore.h;
  1150. - bypass = "extern \"C\"";
  1151. - bypass = "__BEGIN_DECLS";
  1152. - c_fix = wrap;
  1153. - c_fix_arg = "#ifdef __cplusplus\n"
  1154. - "extern \"C\" {\n"
  1155. - "#endif\n";
  1156. - c_fix_arg = "#ifdef __cplusplus\n"
  1157. - "}\n"
  1158. - "#endif\n";
  1159. - test_text = "extern void swap_fat_header();\n";
  1160. -};
  1161. -
  1162. -/*
  1163. - * AvailabilityMacros.h on Darwin breaks with GCC 4.0, because of
  1164. - * bad __GNUC__ tests.
  1165. - */
  1166. -fix = {
  1167. - hackname = darwin_gcc4_breakage;
  1168. - mach = "*-*-darwin*";
  1169. - files = AvailabilityMacros.h;
  1170. - select = "\\(__GNUC__ >= 3\\) && \\(__GNUC_MINOR__ >= 1\\)";
  1171. - c_fix = format;
  1172. - c_fix_arg = "((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))";
  1173. - test_text = "#if defined(__GNUC__) && (__GNUC__ >= 3) && "
  1174. - "(__GNUC_MINOR__ >= 1)\n";
  1175. -};
  1176. -
  1177. -/*
  1178. - * math.h hides the long long functions that are available on the system for
  1179. - * 10.5 and 10.6 SDKs, we expect to use them in G++ without specifying a value
  1180. - * for __STDC_VERSION__, or switching __STRICT_ANSI__ off.
  1181. - */
  1182. -fix = {
  1183. - hackname = darwin_ll_funcs_avail;
  1184. - mach = "*-*-darwin*";
  1185. - files = architecture/ppc/math.h, architecture/i386/math.h;
  1186. - select = "#if[^_]*__STDC_VERSION__[^_]*__STDC_VERSION__[^1]*199901L[^_]*"
  1187. - "__STRICT_ANSI__[^_]*__GNUC__[^\)]*";
  1188. - sed = "s/#if[^_]*__STDC_VERSION__[^_]*__STDC_VERSION__[^_]*199901L[^_]*"
  1189. - "__STRICT_ANSI__[^_]*__GNUC__[^\\)]*\)/#if\ !\(__DARWIN_NO_LONG_LONG\)/";
  1190. - test_text = "#if\ !(__DARWIN_NO_LONG_LONG)";
  1191. -};
  1192. -
  1193. -/*
  1194. - * Before Mac OS X 10.8 <i386/setjmp.h> doesn't mark longjump noreturn.
  1195. - */
  1196. -fix = {
  1197. - hackname = darwin_longjmp_noreturn;
  1198. - mach = "*-*-darwin*";
  1199. - files = "i386/setjmp.h";
  1200. - bypass = "__dead2";
  1201. - select = "(.*longjmp\\(.*jmp_buf.*[^)]+\\));";
  1202. - c_fix = format;
  1203. - c_fix_arg = "%1 __attribute__ ((__noreturn__));";
  1204. -
  1205. - test_text = "void siglongjmp(sigjmp_buf, int);";
  1206. -};
  1207. -
  1208. -/*
  1209. - * Mac OS X 10.11 <os/trace.h> uses attribute on function definition.
  1210. - */
  1211. -fix = {
  1212. - hackname = darwin_os_trace_1;
  1213. - mach = "*-*-darwin*";
  1214. - files = os/trace.h;
  1215. - select = "^(_os_trace_verify_printf.*) (__attribute__.*)";
  1216. - c_fix = format;
  1217. - c_fix_arg = "%1";
  1218. - test_text = "_os_trace_verify_printf(const char *msg, ...) __attribute__((format(printf, 1, 2)))";
  1219. -};
  1220. -
  1221. -/*
  1222. - * Mac OS X 10.1[012] <os/trace.h> os_trace_payload_t typedef uses Blocks
  1223. - * extension without guard.
  1224. - */
  1225. -fix = {
  1226. - hackname = darwin_os_trace_2;
  1227. - mach = "*-*-darwin*";
  1228. - files = os/trace.h;
  1229. - select = "typedef.*\\^os_trace_payload_t.*";
  1230. - c_fix = format;
  1231. - c_fix_arg = "#if __BLOCKS__\n%0\n#endif";
  1232. - test_text = "typedef void (^os_trace_payload_t)(xpc_object_t xdict);";
  1233. -};
  1234. -
  1235. -/*
  1236. - * In Mac OS X 10.1[012] <os/trace.h>, need to guard users of
  1237. - * os_trace_payload_t typedef, too.
  1238. - */
  1239. -fix = {
  1240. - hackname = darwin_os_trace_3;
  1241. - mach = "*-*-darwin*";
  1242. - files = os/trace.h;
  1243. - select = <<- _EOSelect_
  1244. - __(API|OSX)_.*
  1245. - OS_EXPORT.*
  1246. - .*
  1247. - _os_trace.*os_trace_payload_t payload);
  1248. - _EOSelect_;
  1249. - c_fix = format;
  1250. - c_fix_arg = "#if __BLOCKS__\n%0\n#endif";
  1251. - test_text = <<- _EOText_
  1252. - __API_AVAILABLE(macosx(10.10), ios(8.0), watchos(2.0), tvos(8.0))
  1253. - OS_EXPORT OS_NOTHROW OS_NOT_TAIL_CALLED
  1254. - void
  1255. - _os_trace_with_buffer(void *dso, const char *message, uint8_t type, const void *buffer, size_t buffer_size, os_trace_payload_t payload);
  1256. -
  1257. - __OSX_AVAILABLE_STARTING(__MAC_10_12, __IPHONE_10_0)
  1258. - OS_EXPORT OS_NOTHROW
  1259. - void
  1260. - _os_trace_internal(void *dso, uint8_t type, const char *format, const uint8_t *buf, size_t buf_size, os_trace_payload_t payload);
  1261. - _EOText_;
  1262. -};
  1263. -
  1264. -/*
  1265. - * In macOS 10.10 <os/base.h>, doesn't have __has_extension guarded.
  1266. - */
  1267. -fix = {
  1268. - hackname = darwin_os_base_1;
  1269. - mach = "*-*-darwin*";
  1270. - files = os/base.h;
  1271. - select = <<- OS_BASE_1_SEL
  1272. -#define __has_attribute.*
  1273. -#endif
  1274. -OS_BASE_1_SEL;
  1275. - c_fix = format;
  1276. - c_fix_arg = <<- OS_BASE_1_FIX
  1277. -%0
  1278. -#ifndef __has_extension
  1279. -#define __has_extension(x) 0
  1280. -#endif
  1281. -OS_BASE_1_FIX;
  1282. - test_text = <<- OS_BASE_1_TEST
  1283. -#define __has_attribute(x) 0
  1284. -#endif
  1285. -
  1286. -#if __GNUC__
  1287. -OS_BASE_1_TEST;
  1288. -};
  1289. -
  1290. -/*
  1291. - * In macOS 10.10 <dispatch/object.h>, has unguarded block syntax.
  1292. - */
  1293. -fix = {
  1294. - hackname = darwin_dispatch_object_1;
  1295. - mach = "*-*-darwin*";
  1296. - files = dispatch/object.h;
  1297. - select = "typedef void.*\\^dispatch_block_t.*";
  1298. - c_fix = format;
  1299. - c_fix_arg = "#if __BLOCKS__\n%0\n#endif";
  1300. - test_text = <<- DISPATCH_OBJECT_1_TEST
  1301. -typedef void (^dispatch_block_t)(void);
  1302. -
  1303. -__BEGIN_DECLS
  1304. -DISPATCH_OBJECT_1_TEST;
  1305. -};
  1306. -
  1307. -/*
  1308. - * __private_extern__ doesn't exist in FSF GCC. Even if it did,
  1309. - * why would you ever put it in a system header file?
  1310. - */
  1311. -fix = {
  1312. - hackname = darwin_private_extern;
  1313. - mach = "*-*-darwin*";
  1314. - files = mach-o/dyld.h;
  1315. - select = "__private_extern__ [a-z_]+ _dyld_";
  1316. - c_fix = format;
  1317. - c_fix_arg = "extern";
  1318. - c_fix_arg = "__private_extern__";
  1319. - test_text = "__private_extern__ int _dyld_func_lookup(\n"
  1320. - "const char *dyld_func_name,\n"
  1321. - "unsigned long *address);\n";
  1322. -};
  1323. -
  1324. -/*
  1325. - * Darwin headers have a stdint.h that defines UINT8_C and UINT16_C to
  1326. - * unsigned constants.
  1327. - */
  1328. -fix = {
  1329. - hackname = darwin_stdint_1;
  1330. - mach = "*-*-darwin*";
  1331. - files = stdint-darwin.h, stdint.h;
  1332. - c_fix = format;
  1333. - c_fix_arg = "#define UINT8_C(v)\tv\n#define UINT16_C(v)\tv";
  1334. - select = "#define UINT8_C\\(v\\)[ \t]+\\(v ## U\\)\n"
  1335. - "#define UINT16_C\\(v\\)[ \t]+\\(v ## U\\)";
  1336. - test_text = "#define UINT8_C(v) (v ## U)\n"
  1337. - "#define UINT16_C(v) (v ## U)";
  1338. -};
  1339. -
  1340. -/*
  1341. - * Darwin headers have a stdint.h that defines INTPTR_MIN and INTPTR_MAX
  1342. - * with wrong types.
  1343. - */
  1344. -fix = {
  1345. - hackname = darwin_stdint_2;
  1346. - mach = "*-*-darwin*";
  1347. - files = stdint-darwin.h, stdint.h;
  1348. - c_fix = format;
  1349. - c_fix_arg = "#if __WORDSIZE == 64\n"
  1350. - "#define INTPTR_MAX 9223372036854775807L\n"
  1351. - "#define INTPTR_MIN (-INTPTR_MAX-1)\n"
  1352. - "#else\n"
  1353. - "#define INTPTR_MAX 2147483647L\n"
  1354. - "#define INTPTR_MIN (-INTPTR_MAX-1)\n"
  1355. - "#endif";
  1356. - select = "#if __WORDSIZE == 64\n"
  1357. - "#define INTPTR_MIN[ \t]+INT64_MIN\n"
  1358. - "#define INTPTR_MAX[ \t]+INT64_MAX\n"
  1359. - "#else\n"
  1360. - "#define INTPTR_MIN[ \t]+INT32_MIN\n"
  1361. - "#define INTPTR_MAX[ \t]+INT32_MAX\n"
  1362. - "#endif";
  1363. - test_text = "#if __WORDSIZE == 64\n"
  1364. - "#define INTPTR_MIN INT64_MIN\n"
  1365. - "#define INTPTR_MAX INT64_MAX\n"
  1366. - "#else\n"
  1367. - "#define INTPTR_MIN INT32_MIN\n"
  1368. - "#define INTPTR_MAX INT32_MAX\n"
  1369. - "#endif";
  1370. -};
  1371. -
  1372. -/*
  1373. - * Darwin headers have a stdint.h that defines UINTPTR_MAX with a wrong type.
  1374. - */
  1375. -fix = {
  1376. - hackname = darwin_stdint_3;
  1377. - mach = "*-*-darwin*";
  1378. - files = stdint-darwin.h, stdint.h;
  1379. - c_fix = format;
  1380. - c_fix_arg = "#if __WORDSIZE == 64\n"
  1381. - "#define UINTPTR_MAX 18446744073709551615UL\n"
  1382. - "#else\n"
  1383. - "#define UINTPTR_MAX 4294967295UL\n"
  1384. - "#endif";
  1385. - select = "#if __WORDSIZE == 64\n"
  1386. - "#define UINTPTR_MAX[ \t]+UINT64_MAX\n"
  1387. - "#else\n"
  1388. - "#define UINTPTR_MAX[ \t]+UINT32_MAX\n"
  1389. - "#endif";
  1390. - test_text = "#if __WORDSIZE == 64\n"
  1391. - "#define UINTPTR_MAX UINT64_MAX\n"
  1392. - "#else\n"
  1393. - "#define UINTPTR_MAX UINT32_MAX\n"
  1394. - "#endif";
  1395. -};
  1396. -
  1397. -/*
  1398. - * Darwin headers have a stdint.h that defines SIZE_MAX with a wrong type.
  1399. - */
  1400. -fix = {
  1401. - hackname = darwin_stdint_4;
  1402. - mach = "*-*-darwin*";
  1403. - files = stdint-darwin.h, stdint.h;
  1404. - c_fix = format;
  1405. - c_fix_arg = "#if __WORDSIZE == 64\n"
  1406. - "#define SIZE_MAX 18446744073709551615UL\n"
  1407. - "#else\n"
  1408. - "#define SIZE_MAX 4294967295UL\n"
  1409. - "#endif";
  1410. - select = "#if __WORDSIZE == 64\n"
  1411. - "#define SIZE_MAX[ \t]+UINT64_MAX\n"
  1412. - "#else\n"
  1413. - "#define SIZE_MAX[ \t]+UINT32_MAX\n"
  1414. - "#endif";
  1415. - test_text = "#if __WORDSIZE == 64\n"
  1416. - "#define SIZE_MAX UINT64_MAX\n"
  1417. - "#else\n"
  1418. - "#define SIZE_MAX UINT32_MAX\n"
  1419. - "#endif";
  1420. -};
  1421. -
  1422. -/*
  1423. - * Darwin headers have a stdint.h that defines {U,}INTMAX_{MIN,MAX}
  1424. - * with a wrong type.
  1425. - */
  1426. -fix = {
  1427. - hackname = darwin_stdint_5;
  1428. - mach = "*-*-darwin*";
  1429. - files = stdint-darwin.h, stdint.h;
  1430. - c_fix = format;
  1431. - c_fix_arg = "#if __WORDSIZE == 64\n"
  1432. - "#define INTMAX_MIN (-9223372036854775807L - 1)\n"
  1433. - "#define INTMAX_MAX 9223372036854775807L\n"
  1434. - "#define UINTMAX_MAX 18446744073709551615UL\n"
  1435. - "#else\n"
  1436. - "#define INTMAX_MIN (-9223372036854775807LL - 1)\n"
  1437. - "#define INTMAX_MAX 9223372036854775807LL\n"
  1438. - "#define UINTMAX_MAX 18446744073709551615ULL\n"
  1439. - "#endif";
  1440. - select = "#define INTMAX_MIN[ \t]+INT64_MIN\n"
  1441. - "#define INTMAX_MAX[ \t]+INT64_MAX\n"
  1442. - "\n"
  1443. - "#define UINTMAX_MAX[ \t]+UINT64_MAX";
  1444. - test_text = "#define INTMAX_MIN INT64_MIN\n"
  1445. - "#define INTMAX_MAX INT64_MAX\n"
  1446. - "\n"
  1447. - "#define UINTMAX_MAX UINT64_MAX";
  1448. -};
  1449. -
  1450. -/*
  1451. - * Darwin headers have a stdint.h that defines {U,}INTMAX_C
  1452. - * with a wrong type.
  1453. - */
  1454. -fix = {
  1455. - hackname = darwin_stdint_6;
  1456. - mach = "*-*-darwin*";
  1457. - files = stdint-darwin.h, stdint.h;
  1458. - c_fix = format;
  1459. - c_fix_arg = "#if __WORDSIZE == 64\n"
  1460. - "#define PTRDIFF_MIN (-9223372036854775807L - 1)\n"
  1461. - "#define PTRDIFF_MAX 9223372036854775807L\n"
  1462. - "#else\n"
  1463. - "#define PTRDIFF_MIN (-2147483647 - 1)\n"
  1464. - "#define PTRDIFF_MAX 2147483647\n"
  1465. - "#endif";
  1466. - select = "#if __WORDSIZE == 64\n"
  1467. - "#define PTRDIFF_MIN[ \t]+INT64_MIN\n"
  1468. - "#define PTRDIFF_MAX[ \t]+INT64_MAX\n"
  1469. - "#else\n"
  1470. - "#define PTRDIFF_MIN[ \t]+INT32_MIN\n"
  1471. - "#define PTRDIFF_MAX[ \t]+INT32_MAX\n"
  1472. - "#endif";
  1473. - test_text = "#if __WORDSIZE == 64\n"
  1474. - "#define PTRDIFF_MIN INT64_MIN\n"
  1475. - "#define PTRDIFF_MAX INT64_MAX\n"
  1476. - "#else\n"
  1477. - "#define PTRDIFF_MIN INT32_MIN\n"
  1478. - "#define PTRDIFF_MAX INT32_MAX\n"
  1479. - "#endif";
  1480. -};
  1481. -
  1482. -/*
  1483. - * Darwin headers have a stdint.h that defines {U,}INTMAX_C
  1484. - * with a wrong type.
  1485. - */
  1486. -fix = {
  1487. - hackname = darwin_stdint_7;
  1488. - mach = "*-*-darwin*";
  1489. - files = stdint-darwin.h, stdint.h;
  1490. - c_fix = format;
  1491. - c_fix_arg = "#if __WORDSIZE == 64\n"
  1492. - "#define INTMAX_C(v) (v ## L)\n"
  1493. - "#define UINTMAX_C(v) (v ## UL)\n"
  1494. - "#else\n"
  1495. - "#define INTMAX_C(v) (v ## LL)\n"
  1496. - "#define UINTMAX_C(v) (v ## ULL)\n"
  1497. - "#endif";
  1498. - select = "#define INTMAX_C\\(v\\)[ \t]+\\(v ## LL\\)\n"
  1499. - "#define UINTMAX_C\\(v\\)[ \t]+\\(v ## ULL\\)";
  1500. - test_text = "#define INTMAX_C(v) (v ## LL)\n"
  1501. - "#define UINTMAX_C(v) (v ## ULL)";
  1502. -};
  1503. -
  1504. -/* The SDK included with XCode 10.2 has the file <sys/ucred.h> that uses the
  1505. - C11 _Atomic keyword (exposing it to C++ code). The work-around here follows
  1506. - the header in declaring the entity volatile when _Atomic is not available.
  1507. -*/
  1508. -fix = {
  1509. - hackname = darwin_ucred__Atomic;
  1510. - mach = "*-*-darwin*";
  1511. - files = sys/ucred.h;
  1512. - select = "_Atomic";
  1513. - c_fix = wrap;
  1514. - c_fix_arg = "#if (__STDC_VERSION__ < 201112L) || defined(__cplusplus)\n"
  1515. - "# define _Atomic volatile\n"
  1516. - "#endif\n";
  1517. - c_fix_arg = "#if (__STDC_VERSION__ < 201112L) || defined(__cplusplus)\n"
  1518. - "# undef _Atomic\n"
  1519. - "#endif\n";
  1520. - test_text = ""; /* Don't provide this for wrap fixes. */
  1521. -};
  1522. -
  1523. -/*
  1524. - * Fix <c_asm.h> on Digital UNIX V4.0:
  1525. - * It contains a prototype for a DEC C internal asm() function,
  1526. - * clashing with gcc's asm keyword. So protect this with __DECC.
  1527. - */
  1528. -fix = {
  1529. - hackname = dec_intern_asm;
  1530. - files = c_asm.h;
  1531. - sed = "/^[ \t]*float[ \t]*fasm/i\\\n#ifdef __DECC\n";
  1532. - sed = "/^[ \t]*#[ \t]*pragma[ \t]*intrinsic([ \t]*dasm/a\\\n"
  1533. - "#endif\n";
  1534. - test_text =
  1535. - "float fasm {\n"
  1536. - " ... asm stuff ...\n"
  1537. - "};\n#pragma intrinsic( dasm )\n/* END ASM TEST*/";
  1538. -};
  1539. -
  1540. -/*
  1541. - * Fix typo in <wchar.h> on DJGPP 2.03.
  1542. - */
  1543. -fix = {
  1544. - hackname = djgpp_wchar_h;
  1545. - file = wchar.h;
  1546. - select = "__DJ_wint_t";
  1547. - bypass = "sys/djtypes.h";
  1548. - c_fix = format;
  1549. - c_fix_arg = "%0\n#include <sys/djtypes.h>";
  1550. - c_fix_arg = "#include <stddef.h>";
  1551. - test_text = "#include <stddef.h>\n"
  1552. - "extern __DJ_wint_t x;\n";
  1553. -};
  1554. -
  1555. -/*
  1556. - * Fix these Sun OS files to avoid an invalid identifier in an #ifdef.
  1557. - */
  1558. -fix = {
  1559. - hackname = ecd_cursor;
  1560. - files = "sunwindow/win_lock.h";
  1561. - files = "sunwindow/win_cursor.h";
  1562. - select = 'ecd\.cursor';
  1563. - c_fix = format;
  1564. - c_fix_arg = 'ecd_cursor';
  1565. -
  1566. - test_text = "#ifdef ecd.cursor\n#error bogus\n#endif /* ecd+cursor */";
  1567. -};
  1568. -
  1569. -/*
  1570. - * Incorrect feraiseexcept extern inline in bits/fenv.h on x86_64
  1571. - * that fails when compiling for SSE-less 32-bit x86.
  1572. - */
  1573. -fix = {
  1574. - hackname = feraiseexcept_nosse_divbyzero;
  1575. - mach = 'i[34567]86-*-linux*', 'x86*-linux*', 'amd64-*-linux*';
  1576. - files = bits/fenv.h, '*/bits/fenv.h';
  1577. - select = "^([\t ]*)__asm__ __volatile__ \\(\"divss %1, %0 *\" : "
  1578. - ": \"x\" \\(__f\\), \"x\" \\(__g\\)\\);$";
  1579. - bypass = "\"fdivp .*; fwait\"";
  1580. -
  1581. - c_fix = format;
  1582. - c_fix_arg = <<- _EOText_
  1583. - # ifdef __SSE_MATH__
  1584. - %0
  1585. - # else
  1586. - %1__asm__ __volatile__ ("fdivp %%%%st, %%%%st(1); fwait"
  1587. - %1 : "=t" (__f) : "0" (__f), "u" (__g) : "st(1)");
  1588. - # endif
  1589. - _EOText_;
  1590. -
  1591. - test_text = <<- _EOText_
  1592. - __asm__ __volatile__ ("divss %1, %0" : : "x" (__f), "x" (__g));
  1593. - _EOText_;
  1594. -};
  1595. -
  1596. -/*
  1597. - * Incorrect feraiseexcept extern inline in bits/fenv.h on x86_64
  1598. - * that fails when compiling for SSE-less 32-bit x86.
  1599. - */
  1600. -fix = {
  1601. - hackname = feraiseexcept_nosse_invalid;
  1602. - mach = 'i[34567]86-*-linux*', 'x86*-linux*', 'amd64-*-linux*';
  1603. - files = bits/fenv.h, '*/bits/fenv.h';
  1604. - select = "^([\t ]*)__asm__ __volatile__ \\(\"divss %0, %0 *\" : "
  1605. - ": \"x\" \\(__f\\)\\);$";
  1606. - bypass = "\"fdiv .*; fwait\"";
  1607. -
  1608. - c_fix = format;
  1609. - c_fix_arg = <<- _EOText_
  1610. - # ifdef __SSE_MATH__
  1611. - %0
  1612. - # else
  1613. - %1__asm__ __volatile__ ("fdiv %%%%st, %%%%st(0); fwait"
  1614. - %1 : "=t" (__f) : "0" (__f));
  1615. - # endif
  1616. - _EOText_;
  1617. -
  1618. - test_text = <<- _EOText_
  1619. - __asm__ __volatile__ ("divss %0, %0" : : "x" (__f));
  1620. - _EOText_;
  1621. -};
  1622. -
  1623. -/*
  1624. - * Between 8/24/1998 and 2/17/2001, FreeBSD system headers presume
  1625. - * neither the existence of GCC 3 nor its exact feature set yet break
  1626. - * (by design?) when __GNUC__ is set beyond 2.
  1627. - */
  1628. -fix = {
  1629. - hackname = freebsd_gcc3_breakage;
  1630. - mach = "*-*-freebsd*";
  1631. - files = sys/cdefs.h;
  1632. - select = '^#if __GNUC__ == 2 && __GNUC_MINOR__ >= 7$';
  1633. - bypass = '__GNUC__[ \t]*([>=]=[ \t]*[3-9]|>[ \t]*2)';
  1634. - c_fix = format;
  1635. - c_fix_arg = '%0 || __GNUC__ >= 3';
  1636. - test_text = '#if __GNUC__ == 2 && __GNUC_MINOR__ >= 7';
  1637. -};
  1638. -
  1639. -/*
  1640. - * Some releases of FreeBSD 4 and FreeBSD 5.0 and 5.1 system headers presume
  1641. - * neither the existence of GCC 4 nor its exact feature set yet break
  1642. - * (by design?) when __GNUC__ is set beyond 3.
  1643. - */
  1644. -fix = {
  1645. - hackname = freebsd_gcc4_breakage;
  1646. - mach = "*-*-freebsd*";
  1647. - files = sys/cdefs.h;
  1648. - select = '^#if __GNUC__ == 2 && __GNUC_MINOR__ >= 7 \|\| __GNUC__ == 3$';
  1649. - c_fix = format;
  1650. - c_fix_arg = '#if __GNUC__ == 2 && __GNUC_MINOR__ >= 7 || __GNUC__ >= 3';
  1651. - test_text = '#if __GNUC__ == 2 && __GNUC_MINOR__ >= 7 || __GNUC__ == 3';
  1652. -};
  1653. -
  1654. -/*
  1655. - * Some versions of glibc don't expect the C99 inline semantics.
  1656. - */
  1657. -fix = {
  1658. - hackname = glibc_c99_inline_1;
  1659. - files = features.h, '*/features.h';
  1660. - select = "^ *&& !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__$";
  1661. - c_fix = format;
  1662. - c_fix_arg = "%0 && (defined __extern_inline || defined __GNUC_GNU_INLINE__)";
  1663. - test_text = <<-EOT
  1664. - #if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ \
  1665. - && !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__
  1666. - # define __USE_EXTERN_INLINES 1
  1667. - #endif
  1668. - EOT;
  1669. -};
  1670. -
  1671. -/*
  1672. - * Similar, but a version that didn't have __NO_INLINE__
  1673. - */
  1674. -fix = {
  1675. - hackname = glibc_c99_inline_1a;
  1676. - files = features.h, '*/features.h';
  1677. - select = "(\\) && defined __OPTIMIZE__ && !defined __OPTIMIZE_SIZE__)\n"
  1678. - "(#[ \t]*define[ \t]*__USE_EXTERN_INLINES[ \t]*1)";
  1679. - c_fix = format;
  1680. - c_fix_arg = "%1 && (defined __extern_inline || defined __GNUC_GNU_INLINE__)\n%2";
  1681. - test_text = <<-EOT
  1682. - #if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ && !defined __OPTIMIZE_SIZE__
  1683. - # define __USE_EXTERN_INLINES 1
  1684. - #endif
  1685. - EOT;
  1686. -};
  1687. -
  1688. -/*
  1689. - * The glibc_c99_inline_1 fix should have fixed everything. Unfortunately
  1690. - * there are many glibc headers which do not respect __USE_EXTERN_INLINES.
  1691. - * The remaining glibc_c99_inline_* fixes deal with some of those headers.
  1692. - */
  1693. -fix = {
  1694. - hackname = glibc_c99_inline_2;
  1695. - files = sys/stat.h, '*/sys/stat.h';
  1696. - select = "extern __inline__ int";
  1697. - sed = "s/extern int \\(stat\\)/"
  1698. - "#ifdef __GNUC_GNU_INLINE__\\\nextern\\\n#endif\\\n"
  1699. - "__inline__ int \\1/";
  1700. - sed = "s/extern int \\([lf]stat\\)/"
  1701. - "#ifdef __GNUC_GNU_INLINE__\\\nextern\\\n#endif\\\n"
  1702. - "__inline__ int \\1/";
  1703. - sed = "s/extern int \\(mknod\\)/"
  1704. - "#ifdef __GNUC_GNU_INLINE__\\\nextern\\\n#endif\\\n"
  1705. - "__inline__ int \\1/";
  1706. - sed = "s/extern int __REDIRECT\\(_NTH\\)\\{0,1\\} (\\(stat\\)/"
  1707. - "#ifdef __GNUC_GNU_INLINE__\\\nextern\\\n#endif\\\n"
  1708. - "__inline__ int __REDIRECT\\1 (\\2/";
  1709. - sed = "s/extern int __REDIRECT\\(_NTH\\)\\{0,1\\} (\\([lf]stat\\)/"
  1710. - "#ifdef __GNUC_GNU_INLINE__\\\nextern\\\n#endif\\\n"
  1711. - "__inline__ int __REDIRECT\\1 (\\2/";
  1712. - sed = "s/^extern __inline__ int/"
  1713. - "#ifdef __GNUC_GNU_INLINE__\\\nextern\\\n#endif\\\n"
  1714. - "__inline__ int/";
  1715. - test_text = <<-EOT
  1716. - extern int fstat64 (int __fd, struct stat64 *__buf) __THROW __nonnull ((2));
  1717. - extern __inline__ int
  1718. - __NTH (fstat64 (int __fd, struct stat64 *__statbuf))
  1719. - {}
  1720. - EOT;
  1721. -};
  1722. -
  1723. -/*
  1724. - * glibc_c99_inline_3
  1725. - */
  1726. -fix = {
  1727. - hackname = glibc_c99_inline_3;
  1728. - files = bits/string2.h, '*/bits/string2.h';
  1729. - select = "extern __inline";
  1730. - bypass = "__extern_inline|__GNU_STDC_INLINE__";
  1731. - c_fix = format;
  1732. - c_fix_arg = "# if defined(__cplusplus) || defined(__GNUC_STDC_INLINE__)";
  1733. - c_fix_arg = "^# ifdef __cplusplus$";
  1734. - test_text = <<-EOT
  1735. - # ifdef __cplusplus
  1736. - # define __STRING_INLINE inline
  1737. - # else
  1738. - # define __STRING_INLINE extern __inline
  1739. - # endif
  1740. - EOT;
  1741. -};
  1742. -
  1743. -/*
  1744. - * glibc_c99_inline_4
  1745. - */
  1746. -fix = {
  1747. - hackname = glibc_c99_inline_4;
  1748. - files = sys/sysmacros.h, '*/sys/sysmacros.h', wchar.h, '*/wchar.h',
  1749. - pthread.h, '*/pthread.h';
  1750. - bypass = "__extern_inline|__gnu_inline__";
  1751. - select = "(^| )extern __inline";
  1752. - c_fix = format;
  1753. - c_fix_arg = "%0 __attribute__ ((__gnu_inline__))";
  1754. - test_text = <<-EOT
  1755. - __extension__ extern __inline unsigned int
  1756. - extern __inline unsigned int
  1757. - EOT;
  1758. -};
  1759. -
  1760. -/* glibc-2.3.5 defines pthread mutex initializers incorrectly,
  1761. - * so we replace them with versions that correspond to the
  1762. - * definition.
  1763. - */
  1764. -fix = {
  1765. - hackname = glibc_mutex_init;
  1766. - files = pthread.h;
  1767. - select = '\{ *\{ *0, *\} *\}';
  1768. - sed = "/define[ \t]\\{1,\\}PTHREAD_MUTEX_INITIALIZER[ \t]*\\\\/{\n"
  1769. - "N\ns/{ { 0, } }/{ { 0, 0, 0, 0, 0, 0 } }/\n}";
  1770. - sed = "s/{ \\(0, 0, 0, 0, PTHREAD_MUTEX_"
  1771. - "\\(RECURSIVE\\)_NP\\) }/{ \\1, 0 }/";
  1772. - sed = "s/{ \\(0, 0, 0, 0, PTHREAD_MUTEX_"
  1773. - "\\(ERRORCHECK\\)_NP\\) }/{ \\1, 0 }/";
  1774. - sed = "s/{ \\(0, 0, 0, 0, PTHREAD_MUTEX_"
  1775. - "\\(ADAPTIVE\\)_NP\\) }/{ \\1, 0 }/";
  1776. - sed = "s/{ \\(0, 0, 0, PTHREAD_MUTEX_"
  1777. - "\\(RECURSIVE\\)_NP\\) }/{ \\1, 0, 0 }/";
  1778. - sed = "s/{ \\(0, 0, 0, PTHREAD_MUTEX_"
  1779. - "\\(ERRORCHECK\\)_NP\\) }/{ \\1, 0, 0 }/";
  1780. - sed = "s/{ \\(0, 0, 0, PTHREAD_MUTEX_"
  1781. - "\\(ADAPTIVE\\)_NP\\) }/{ \\1, 0, 0 }/";
  1782. - sed = "/define[ \t]\\{1,\\}PTHREAD_RWLOCK_INITIALIZER[ \t]*\\\\/"
  1783. - "N;s/^[ \t]*#[ \t]*"
  1784. - "\\(define[ \t]\\{1,\\}PTHREAD_RWLOCK_INITIALIZER[ \t]*\\\\\\)\\n"
  1785. - "[ \t]*{ { 0, } }/# if __WORDSIZE == 64\\\n"
  1786. - "# \\1\\\n"
  1787. - " { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }\\\n"
  1788. - "# else\\\n"
  1789. - "# \\1\\\n"
  1790. - " { { 0, 0, 0, 0, 0, 0, 0, 0 } }\\\n"
  1791. - "# endif/";
  1792. - sed = "s/{ \\(0, 0, 0, 0, 0, 0, "
  1793. - "PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP\\) }/{ \\1, 0 }/";
  1794. - sed = "/define[ \t]\\{1,\\}PTHREAD_COND_INITIALIZER/"
  1795. - "s/{ { 0, } }/{ { 0, 0, 0, 0, 0, (void *) 0, 0, 0 } }/";
  1796. -
  1797. - test_text = <<- _EOText_
  1798. - #define PTHREAD_MUTEX_INITIALIZER \\
  1799. - { { 0, } }
  1800. - #ifdef __USE_GNU
  1801. - # if __WORDSIZE == 64
  1802. - # define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \\
  1803. - { { 0, 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP } }
  1804. - # define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \\
  1805. - { { 0, 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP } }
  1806. - # define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \\
  1807. - { { 0, 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP } }
  1808. - # else
  1809. - # define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \\
  1810. - { { 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP } }
  1811. - # define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \\
  1812. - { { 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP } }
  1813. - # define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \\
  1814. - { { 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP } }
  1815. - # endif
  1816. - #endif
  1817. - # define PTHREAD_RWLOCK_INITIALIZER \\
  1818. - { { 0, } }
  1819. - # ifdef __USE_GNU
  1820. - # if __WORDSIZE == 64
  1821. - # define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \\
  1822. - { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \\
  1823. - PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP } }
  1824. - # else
  1825. - # define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \\
  1826. - { { 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP } }
  1827. - # endif
  1828. - # endif
  1829. - #define PTHREAD_COND_INITIALIZER { { 0, } }
  1830. - _EOText_;
  1831. -};
  1832. -
  1833. -/* glibc versions before 2.5 have a version of stdint.h that defines
  1834. - UINT8_C and UINT16_C to produce unsigned constants, as do uClibc
  1835. - versions with stdint.h based on those glibc versions. */
  1836. -fix = {
  1837. - hackname = glibc_stdint;
  1838. - files = stdint.h;
  1839. - select = "GNU C Library";
  1840. - c_fix = format;
  1841. - c_fix_arg = "# define UINT8_C(c)\tc\n# define UINT16_C(c)\tc";
  1842. - c_fix_arg = "# define UINT8_C\\(c\\)\tc ## U\n# define UINT16_C\\(c\\)\tc ## U";
  1843. - test_text = "/* This file is part of the GNU C Library. */\n"
  1844. - "# define UINT8_C(c)\tc ## U\n"
  1845. - "# define UINT16_C(c)\tc ## U";
  1846. -};
  1847. -
  1848. -/* Some versions of glibc have a version of bits/string2.h that
  1849. - produces "value computed is not used" warnings from strncpy; fix
  1850. - this definition by using __builtin_strncpy instead as in newer
  1851. - versions. */
  1852. -fix = {
  1853. - hackname = glibc_strncpy;
  1854. - files = bits/string2.h, '*/bits/string2.h';
  1855. - bypass = "__builtin_strncpy";
  1856. - c_fix = format;
  1857. - c_fix_arg = "# define strncpy(dest, src, n) __builtin_strncpy (dest, src, n)";
  1858. - c_fix_arg = "# define strncpy([^\n]*\\\\\n)*[^\n]*";
  1859. - test_text = <<-EOT
  1860. - # define strncpy(dest, src, n) \
  1861. - (__extension__ (__builtin_constant_p (src) && __builtin_constant_p (n) \\
  1862. - ? (strlen (src) + 1 >= ((size_t) (n)) \\
  1863. - ? (char *) memcpy (dest, src, n) \\
  1864. - : strncpy (dest, src, n)) \\
  1865. - : strncpy (dest, src, n)))
  1866. - EOT;
  1867. -
  1868. -};
  1869. -
  1870. -/* glibc's tgmath.h relies on an expression that is not an integer
  1871. - constant expression being treated as it was by GCC 4.4 and
  1872. - earlier. */
  1873. -fix = {
  1874. - hackname = glibc_tgmath;
  1875. - files = tgmath.h;
  1876. - select = '\(\(\(type\) 0.25\) && \(\(type\) 0.25 - 1\)\)';
  1877. - bypass = "__floating_type\\(type\\) \\\\\n.*__builtin_classify_type";
  1878. - c_fix = format;
  1879. - c_fix_arg = "(__builtin_classify_type ((type) 0) == 8 || "
  1880. - "(__builtin_classify_type ((type) 0) == 9 && "
  1881. - "__builtin_classify_type (__real__ ((type) 0)) == 8))";
  1882. - test_text = "# define __floating_type(type) (((type) 0.25) && ((type) 0.25 - 1))";
  1883. -};
  1884. -
  1885. -/*
  1886. - * Fix these files to use the types we think they should for
  1887. - * ptrdiff_t, size_t, and wchar_t.
  1888. - *
  1889. - * This defines the types in terms of macros predefined by our 'cpp'.
  1890. - * This is supposedly necessary for glibc's handling of these types.
  1891. - * It's probably not necessary for anyone else, but it doesn't hurt.
  1892. - */
  1893. -fix = {
  1894. - hackname = gnu_types;
  1895. - files = "sys/types.h";
  1896. - files = "stdlib.h";
  1897. - files = "sys/stdtypes.h";
  1898. - files = "stddef.h";
  1899. - files = "memory.h";
  1900. - files = "unistd.h";
  1901. - bypass = '_GCC_(PTRDIFF|SIZE|WCHAR)_T';
  1902. - select = "^[ \t]*typedef[ \t]+.*[ \t](ptrdiff|size|wchar)_t;";
  1903. - c_fix = gnu_type;
  1904. - /* The Solaris 10 headers already define these types correctly. */
  1905. - mach = '*-*-solaris2.1[0-9]*';
  1906. - not_machine = true;
  1907. -
  1908. - test_text = "typedef long int ptrdiff_t; /* long int */\n"
  1909. - "typedef uint_t size_t; /* uint_t */\n"
  1910. - "typedef ushort_t wchar_t; /* ushort_t */";
  1911. -};
  1912. -
  1913. -/*
  1914. - * Fix HP & Sony's use of "../machine/xxx.h"
  1915. - * to refer to: <machine/xxx.h>
  1916. - */
  1917. -fix = {
  1918. - hackname = hp_inline;
  1919. - files = sys/spinlock.h;
  1920. - files = machine/machparam.h;
  1921. - select = "[ \t]*#[ \t]*include[ \t]+" '"\.\./machine/';
  1922. -
  1923. - c_fix = format;
  1924. - c_fix_arg = "%1<machine/%2.h>";
  1925. -
  1926. - c_fix_arg = "([ \t]*#[ \t]*include[ \t]+)" '"\.\./machine/'
  1927. - '([a-z]+)\.h"';
  1928. -
  1929. - test_text = ' # include "../machine/mumble.h"';
  1930. -};
  1931. -
  1932. -/*
  1933. - * Check for (...) in C++ code in HP/UX sys/file.h.
  1934. - */
  1935. -fix = {
  1936. - hackname = hp_sysfile;
  1937. - files = sys/file.h;
  1938. - select = "HPUX_SOURCE";
  1939. -
  1940. - c_fix = format;
  1941. - c_fix_arg = "(struct file *, ...)";
  1942. - c_fix_arg = '\(\.\.\.\)';
  1943. -
  1944. - test_text = "extern void foo(...); /* HPUX_SOURCE - bad varargs */";
  1945. -};
  1946. -
  1947. -/*
  1948. - * Un-Hide a series of five FP defines from post-1999 compliance GCC:
  1949. - * FP_NORMAL, FP_ZERO, FP_INFINITE, FP_SUBNORMAL and FP_NAN
  1950. - */
  1951. -fix = {
  1952. - hackname = hppa_hpux_fp_macros;
  1953. - mach = "hppa*-hp-hpux11*";
  1954. - files = math.h;
  1955. - select = "#[ \t]*define[ \t]*FP_NORMAL.*\n"
  1956. - "#[ \t]*define[ \t]*FP_ZERO.*\n"
  1957. - "#[ \t]*define[ \t]*FP_INFINITE.*\n"
  1958. - "#[ \t]*define[ \t]*FP_SUBNORMAL.*\n"
  1959. - "#[ \t]*define[ \t]*FP_NAN.*\n";
  1960. - c_fix = format;
  1961. - c_fix_arg = <<- _EOFix_
  1962. - #endif /* _INCLUDE_HPUX_SOURCE */
  1963. -
  1964. - #if defined(_INCLUDE_HPUX_SOURCE) || \
  1965. - (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))
  1966. - %0#endif
  1967. -
  1968. - #ifdef _INCLUDE_HPUX_SOURCE
  1969. -
  1970. - _EOFix_;
  1971. -
  1972. - test_text =
  1973. - "# define FP_NORMAL 0\n"
  1974. - "# define FP_ZERO 1\n"
  1975. - "# define FP_INFINITE 2\n"
  1976. - "# define FP_SUBNORMAL 3\n"
  1977. - "# define FP_NAN 4\n";
  1978. -};
  1979. -
  1980. -/*
  1981. - * Delete C++ double pow (double, int) inline function from HP-UX 10 & 11
  1982. - * math.h to prevent clash with define in c_std/bits/std_cmath.h.
  1983. - */
  1984. -fix = {
  1985. - hackname = hpux10_cpp_pow_inline;
  1986. - files = fixinc-test-limits.h, math.h;
  1987. - select = <<- END_POW_INLINE
  1988. - ^# +ifdef +__cplusplus
  1989. - +\}
  1990. - +inline +double +pow\(double +__d,int +__expon\) +\{
  1991. - [ ]+return +pow\(__d,\(double\)__expon\);
  1992. - +\}
  1993. - +extern +"C" +\{
  1994. - #else
  1995. - # +endif
  1996. - END_POW_INLINE;
  1997. -
  1998. - c_fix = format;
  1999. - c_fix_arg = "";
  2000. -
  2001. - test_text =
  2002. - "# ifdef __cplusplus\n"
  2003. - " }\n"
  2004. - " inline double pow(double __d,int __expon) {\n"
  2005. - "\t return pow(__d,(double)__expon);\n"
  2006. - " }\n"
  2007. - ' extern "C"' " {\n"
  2008. - "#else\n"
  2009. - "# endif";
  2010. -};
  2011. -
  2012. -fix = {
  2013. - hackname = hpux11_cpp_pow_inline;
  2014. - files = math.h;
  2015. - select = " +inline double pow\\(double d,int expon\\) \\{\n"
  2016. - " +return pow\\(d, \\(double\\)expon\\);\n"
  2017. - " +\\}\n";
  2018. - c_fix = format;
  2019. - c_fix_arg = "";
  2020. -
  2021. - test_text =
  2022. - " inline double pow(double d,int expon) {\n"
  2023. - " return pow(d, (double)expon);\n"
  2024. - " }\n";
  2025. -};
  2026. -
  2027. -/*
  2028. - * Fix hpux 10.X missing ctype declarations 1
  2029. - */
  2030. -fix = {
  2031. - hackname = hpux10_ctype_declarations1;
  2032. - files = ctype.h;
  2033. - select = "^#[ \t]*define _toupper\\(__c\\)[ \t]*__toupper\\(__c\\)";
  2034. - bypass = "^[ \t]*extern[ \t]*int[ \t]*__tolower[ \t]*\\(";
  2035. - c_fix = format;
  2036. - c_fix_arg = "#ifdef _PROTOTYPES\n"
  2037. - "extern int __tolower(int);\n"
  2038. - "extern int __toupper(int);\n"
  2039. - "#else /* NOT _PROTOTYPES */\n"
  2040. - "extern int __tolower();\n"
  2041. - "extern int __toupper();\n"
  2042. - "#endif /* _PROTOTYPES */\n\n"
  2043. - "%0\n";
  2044. -
  2045. - test_text = "# define _toupper(__c) __toupper(__c)\n";
  2046. -};
  2047. -
  2048. -/*
  2049. - * Fix hpux 10.X missing ctype declarations 2
  2050. - */
  2051. -fix = {
  2052. - hackname = hpux10_ctype_declarations2;
  2053. - files = ctype.h;
  2054. - select = "^# if defined\\(_SB_CTYPE_MACROS\\) && \\!defined\\(__lint\\)";
  2055. - bypass = "^[ \t]*extern[ \t]*int[ \t]*_isalnum[ \t]*\\(";
  2056. - c_fix = format;
  2057. - c_fix_arg = "%0\n\n"
  2058. - "#ifdef _PROTOTYPES\n"
  2059. - " extern int _isalnum(int);\n"
  2060. - " extern int _isalpha(int);\n"
  2061. - " extern int _iscntrl(int);\n"
  2062. - " extern int _isdigit(int);\n"
  2063. - " extern int _isgraph(int);\n"
  2064. - " extern int _islower(int);\n"
  2065. - " extern int _isprint(int);\n"
  2066. - " extern int _ispunct(int);\n"
  2067. - " extern int _isspace(int);\n"
  2068. - " extern int _isupper(int);\n"
  2069. - " extern int _isxdigit(int);\n"
  2070. - "# else /* not _PROTOTYPES */\n"
  2071. - " extern int _isalnum();\n"
  2072. - " extern int _isalpha();\n"
  2073. - " extern int _iscntrl();\n"
  2074. - " extern int _isdigit();\n"
  2075. - " extern int _isgraph();\n"
  2076. - " extern int _islower();\n"
  2077. - " extern int _isprint();\n"
  2078. - " extern int _ispunct();\n"
  2079. - " extern int _isspace();\n"
  2080. - " extern int _isupper();\n"
  2081. - " extern int _isxdigit();\n"
  2082. - "#endif /* _PROTOTYPES */\n";
  2083. -
  2084. - test_text = "# if defined(_SB_CTYPE_MACROS) && !defined(__lint)\n"
  2085. - " extern unsigned int *__SB_masks;\n";
  2086. -};
  2087. -
  2088. -/*
  2089. - * Fix hpux 10.X missing stdio declarations
  2090. - */
  2091. -fix = {
  2092. - hackname = hpux10_stdio_declarations;
  2093. - files = stdio.h;
  2094. - select = "^#[ \t]*define _iob[ \t]*__iob";
  2095. - bypass = "^[ \t]*extern[ \t]*int[ \t]*vsnprintf[ \t]*\\(";
  2096. - c_fix = format;
  2097. - c_fix_arg = "%0\n\n"
  2098. - "# if defined(__STDC__) || defined(__cplusplus)\n"
  2099. - " extern int snprintf(char *, size_t, const char *, ...);\n"
  2100. - " extern int vsnprintf(char *, size_t, const char *, __va_list);\n"
  2101. - "# else /* not __STDC__) || __cplusplus */\n"
  2102. - " extern int snprintf();\n"
  2103. - " extern int vsnprintf();\n"
  2104. - "# endif /* __STDC__) || __cplusplus */\n";
  2105. -
  2106. - test_text = "# define _iob __iob\n";
  2107. -};
  2108. -
  2109. -/*
  2110. - * The HP-UX stddef.h is replaced by gcc's. It doesn't include sys/stdsyms.h.
  2111. - * As a result, we need to include sys/stdsyms.h in alloca.h.
  2112. - */
  2113. -fix = {
  2114. - hackname = hppa_hpux11_alloca;
  2115. - mach = "hppa*-*-hpux11*";
  2116. - files = alloca.h;
  2117. - select = "#ifndef _STDDEF_INCLUDED";
  2118. - c_fix = format;
  2119. - c_fix_arg = "#ifndef _SYS_STDSYMS_INCLUDED\n"
  2120. - "# include <sys/stdsyms.h>\n"
  2121. - "#endif /* _SYS_STDSYMS_INCLUDED */\n\n"
  2122. - "%0";
  2123. -
  2124. - test_text = "#ifndef _STDDEF_INCLUDED";
  2125. -};
  2126. -
  2127. -/*
  2128. - * Make sure hpux defines abs in header.
  2129. - */
  2130. -fix = {
  2131. - hackname = hpux11_abs;
  2132. - mach = "*-hp-hpux11*";
  2133. - files = stdlib.h;
  2134. - select = "ifndef _MATH_INCLUDED";
  2135. - c_fix = format;
  2136. - c_fix_arg = "if !defined(_MATH_INCLUDED) || defined(__GNUG__)";
  2137. - test_text = "#ifndef _MATH_INCLUDED";
  2138. -};
  2139. -
  2140. -/*
  2141. - * Fix hpux11 __LWP_RWLOCK_VALID define
  2142. - */
  2143. -fix = {
  2144. - hackname = hpux11_lwp_rwlock_valid;
  2145. - mach = "*-hp-hpux11*";
  2146. - files = sys/pthread.h;
  2147. - select = "#define __LWP_RWLOCK_VALID[ \t]*0x8c91";
  2148. - c_fix = format;
  2149. - c_fix_arg = "#define __LWP_RWLOCK_VALID -29551";
  2150. - test_text = "#define __LWP_RWLOCK_VALID 0x8c91";
  2151. -};
  2152. -
  2153. -/*
  2154. - * hpux sendfile()
  2155. - */
  2156. -fix = {
  2157. - hackname = hpux11_extern_sendfile;
  2158. - mach = "*-hp-hpux11.[12]*";
  2159. - files = sys/socket.h;
  2160. - select = "^[ \t]*extern sbsize_t sendfile.*\n.*, int\\)\\);\n";
  2161. - c_fix = format;
  2162. - c_fix_arg = "#ifndef _APP32_64BIT_OFF_T\n%0#endif\n";
  2163. - test_text = " extern sbsize_t sendfile __((int, int, off_t, bsize_t,\n"
  2164. - " const struct iovec *, int));\n";
  2165. -};
  2166. -
  2167. -/*
  2168. - * hpux sendpath()
  2169. - */
  2170. -fix = {
  2171. - hackname = hpux11_extern_sendpath;
  2172. - mach = "*-hp-hpux11.[12]*";
  2173. - files = sys/socket.h;
  2174. - select = "^[ \t]*extern sbsize_t sendpath.*\n.*, int\\)\\);\n";
  2175. - c_fix = format;
  2176. - c_fix_arg = "#ifndef _APP32_64BIT_OFF_T\n%0#endif\n";
  2177. - test_text = " extern sbsize_t sendpath __((int, int, off_t, bsize_t,\n"
  2178. - " const struct iovec *, int));\n";
  2179. -};
  2180. -
  2181. -/*
  2182. - * Keep HP-UX 11 from stomping on C++ math namespace
  2183. - * with defines for fabsf.
  2184. - */
  2185. -fix = {
  2186. - hackname = hpux11_fabsf;
  2187. - mach = "*-hp-hpux11*";
  2188. - files = math.h;
  2189. - select = "^[ \t]*#[ \t]*define[ \t]+fabsf\\(.*";
  2190. -
  2191. - c_fix = format;
  2192. - c_fix_arg = "#ifndef __cplusplus\n%0\n#endif";
  2193. -
  2194. - test_text =
  2195. - "#ifdef _PA_RISC\n"
  2196. - "# define fabsf(x) ((float)fabs((double)(float)(x)))\n"
  2197. - "#endif";
  2198. -};
  2199. -
  2200. -/*
  2201. - * The definitions for PTHREAD_MUTEX_INITIALIZER and similar initializers
  2202. - * in pthread.h need to be constant expressions to be standard complient.
  2203. - * As a result, we need to remove the void * casts in the initializers
  2204. - * (see hpux11_pthread_const) and to change the __(M|C|RW)POINTER defines
  2205. - * to use the long type.
  2206. - */
  2207. -fix = {
  2208. - hackname = hpux11_pthread_pointer;
  2209. - mach = "*-hp-hpux11.[0-3]*";
  2210. - files = sys/pthread.h;
  2211. - select = "(void[ \t]*\\*)(m|c|rw)(_ptr)";
  2212. -
  2213. - c_fix = format;
  2214. - c_fix_arg = "long\t%2%3";
  2215. - test_text = "#define __MPOINTER\t\tvoid\t *m_ptr";
  2216. -};
  2217. -
  2218. -/*
  2219. - * Remove void pointer cast and fix C99 constant in __POINTER_SET defines.
  2220. - */
  2221. -fix = {
  2222. - hackname = hpux11_pthread_const;
  2223. - mach = "*-hp-hpux11.[0-3]*";
  2224. - files = sys/pthread.h;
  2225. - select = "^(#define[ \t]+__POINTER_SET[ \t0,]*)(.*\\))";
  2226. -
  2227. - c_fix = format;
  2228. - c_fix_arg = "%11";
  2229. - test_text = "#define __POINTER_SET\t\t((void *) 1LL)";
  2230. -};
  2231. -
  2232. -/*
  2233. - * Prevent HP-UX 11 from defining __size_t and preventing size_t from
  2234. - * being defined by having it define _hpux_size_t instead.
  2235. - */
  2236. -fix = {
  2237. - hackname = hpux11_size_t;
  2238. - mach = "*-hp-hpux11*";
  2239. - select = "__size_t";
  2240. -
  2241. - c_fix = format;
  2242. - c_fix_arg = "_hpux_size_t";
  2243. -
  2244. - test_text =
  2245. - "#define __size_t size_t\n"
  2246. - " extern int getpwuid_r( char *, __size_t, struct passwd **);\n";
  2247. -};
  2248. -
  2249. -/*
  2250. - * Fix hpux 11.00 broken snprintf declaration
  2251. - * (third argument is char *, needs to be const char * to prevent
  2252. - * spurious warnings with -Wwrite-strings or in C++).
  2253. - */
  2254. -fix = {
  2255. - hackname = hpux11_snprintf;
  2256. - files = stdio.h;
  2257. - select = '(extern int snprintf *\(char *\*, *(|__|_hpux_)size_t,)'
  2258. - ' *(char *\*, *\.\.\.\);)';
  2259. - c_fix = format;
  2260. - c_fix_arg = '%1 const %3';
  2261. -
  2262. - test_text = "extern int snprintf(char *, size_t, char *, ...);\n"
  2263. - "extern int snprintf(char *, __size_t, char *, ...);\n"
  2264. - "extern int snprintf(char *, _hpux_size_t, char *, ...);";
  2265. -};
  2266. -
  2267. -/*
  2268. - * Fix hpux 11.00 broken vsnprintf declaration
  2269. - */
  2270. -fix = {
  2271. - hackname = hpux11_vsnprintf;
  2272. - files = stdio.h;
  2273. - select = '(extern int vsnprintf\(char \*, _[hpux]*_size_t, '
  2274. - 'const char \*,) __va__list\);';
  2275. - c_fix = format;
  2276. - c_fix_arg = "%1 __va_list);";
  2277. -
  2278. - test_text = 'extern int vsnprintf(char *, _hpux_size_t, const char *,'
  2279. - ' __va__list);';
  2280. -};
  2281. -
  2282. -/*
  2283. - * Fix missing const in hpux vsscanf declaration
  2284. - */
  2285. -fix = {
  2286. - hackname = hpux_vsscanf;
  2287. - mach = "*-*-hpux*";
  2288. - files = stdio.h;
  2289. - select = '(extern int vsscanf\()char';
  2290. - c_fix = format;
  2291. - c_fix_arg = "%1const char";
  2292. -
  2293. - test_text = 'extern int vsscanf(char *, const char *, __va_list);';
  2294. -};
  2295. -
  2296. -/*
  2297. - * get rid of bogus inline definitions in HP-UX 8.0
  2298. - */
  2299. -fix = {
  2300. - hackname = hpux8_bogus_inlines;
  2301. - files = math.h;
  2302. - select = inline;
  2303. - bypass = "__GNUG__";
  2304. - sed = "s@inline int abs(int [a-z][a-z]*) {.*}"
  2305. - "@extern \"C\" int abs(int);@";
  2306. - sed = "s@inline double abs(double [a-z][a-z]*) {.*}@@";
  2307. - sed = "s@inline int sqr(int [a-z][a-z]*) {.*}@@";
  2308. - sed = "s@inline double sqr(double [a-z][a-z]*) {.*}@@";
  2309. - test_text = "inline int abs(int v) { return (v>=0)?v:-v; }\n"
  2310. - "inline double sqr(double v) { return v**0.5; }";
  2311. -};
  2312. -
  2313. -/*
  2314. - * hpux intptr
  2315. - */
  2316. -fix = {
  2317. - hackname = hpux_c99_intptr;
  2318. - mach = "*-hp-hpux11.3*";
  2319. - files = stdint-hpux11.h, stdint.h;
  2320. - sed = "s@^[ \t]*#[ \t]*define[ \t]*PTRDIFF_MAX[ \t]*"
  2321. - "INT32_MAX[ \t]*$@#define PTRDIFF_MAX (2147483647l)@";
  2322. - sed = "s@^[ \t]*#[ \t]*define[ \t]*PTRDIFF_MIN[ \t]*"
  2323. - "INT32_MIN[ \t]*$@#define PTRDIFF_MIN (-PTRDIFF_MAX - 1)@";
  2324. - sed = "s@^[ \t]*#[ \t]*define[ \t]*INTPTR_MAX[ \t]*"
  2325. - "INT32_MAX[ \t]*$@#define INTPTR_MAX (2147483647l)@";
  2326. - sed = "s@^[ \t]*#[ \t]*define[ \t]*INTPTR_MIN[ \t]*"
  2327. - "INT32_MIN[ \t]*$@#define INTPTR_MIN (-INTPTR_MAX - 1)@";
  2328. - sed = "s@^[ \t]*#[ \t]*define[ \t]*UINTPTR_MAX[ \t]*"
  2329. - "UINT32_MAX[ \t]*$@#define UINTPTR_MAX (4294967295ul)@";
  2330. - sed = "s@^[ \t]*#[ \t]*define[ \t]*SIZE_MAX[ \t]*"
  2331. - "UINT32_MAX[ \t]*$@#define SIZE_MAX (4294967295ul)@";
  2332. - test_text = "#define PTRDIFF_MAX INT32_MAX\n"
  2333. - "#define PTRDIFF_MIN INT32_MIN\n"
  2334. - "#define INTPTR_MAX INT32_MAX\n"
  2335. - "#define INTPTR_MIN INT32_MIN\n"
  2336. - "#define UINTPTR_MAX UINT32_MAX\n"
  2337. - "#define SIZE_MAX UINT32_MAX\n";
  2338. -};
  2339. -
  2340. -/*
  2341. - * These hacks are need in inttypes.h on 11.23 and in stdint.h on 11.31.
  2342. - */
  2343. -fix = {
  2344. - hackname = hpux_c99_inttypes;
  2345. - mach = "*-hp-hpux11.[23]*";
  2346. - files = inttypes.h;
  2347. - files = stdint-hpux11.h, stdint.h;
  2348. - sed = "s@^[ \t]*#[ \t]*define[ \t]*UINT8_C(__c)[ \t]*"
  2349. - "__CONCAT_U__(__c)[ \t]*$@#define UINT8_C(__c) (__c)@";
  2350. - sed = "s@^[ \t]*#[ \t]*define[ \t]*UINT16_C(__c)[ \t]*"
  2351. - "__CONCAT_U__(__c)[ \t]*$@#define UINT16_C(__c) (__c)@";
  2352. - sed = "s@^[ \t]*#[ \t]*define[ \t]*INT32_C(__c)[ \t]*"
  2353. - "__CONCAT__(__c,l)[ \t]*$@#define INT32_C(__c) (__c)@";
  2354. - sed = "s@^[ \t]*#[ \t]*define[ \t]*UINT32_C(__c)[ \t].*$@"
  2355. - "#define UINT32_C(__c) __CONCAT__(__c,u)@";
  2356. - test_text = "#define UINT8_C(__c) __CONCAT_U__(__c)\n"
  2357. - "#define UINT16_C(__c) __CONCAT_U__(__c)\n"
  2358. - "#define INT32_C(__c) __CONCAT__(__c,l)\n"
  2359. - "#define UINT32_C(__c) __CONCAT__(__c,ul)\n";
  2360. -};
  2361. -
  2362. -/*
  2363. - * These hacks are need in inttypes.h on 11.23 and in stdint.h on 11.31.
  2364. - */
  2365. -fix = {
  2366. - hackname = hpux_c99_inttypes2;
  2367. - mach = "*-hp-hpux11.2*";
  2368. - files = stdint-hpux11.h, stdint.h;
  2369. - sed = "s@^[ \t]*#[ \t]*define[ \t]*INT8_C(__c)[ \t]*"
  2370. - "((signed char)(__c))[ \t]*$@#define INT8_C(__c) (__c)@";
  2371. - sed = "s@^[ \t]*#[ \t]*define[ \t]*UINT8_C(__c)[ \t]*"
  2372. - "((unsigned char)(__c))[ \t]*$@#define UINT8_C(__c) (__c)@";
  2373. - sed = "s@^[ \t]*#[ \t]*define[ \t]*INT16_C(__c)[ \t]*"
  2374. - "((short)(__c))[ \t]*$@#define INT16_C(__c) (__c)@";
  2375. - sed = "s@^[ \t]*#[ \t]*define[ \t]*UINT16_C(__c)[ \t]*"
  2376. - "((unsigned short)(__c))[ \t]*$@#define UINT16_C(__c) (__c)@";
  2377. - test_text = "# define INT8_C(__c) ((signed char)(__c))\n"
  2378. - "# define UINT8_C(__c) ((unsigned char)(__c))\n"
  2379. - "# define INT16_C(__c) ((short)(__c))\n"
  2380. - "# define UINT16_C(__c) ((unsigned short)(__c))\n";
  2381. -};
  2382. -
  2383. -/*
  2384. - * Fix broken and missing defines in inttypes.h
  2385. - */
  2386. -fix = {
  2387. - hackname = hpux_c99_inttypes3;
  2388. - mach = "hppa*-hp-hpux11*";
  2389. - files = inttypes.h;
  2390. - select = "#define[ \t]INTPTR_MAX[ \t]*\n"
  2391. - "#define[ \t]UINTPTR_MAX[ \t]*\n";
  2392. - c_fix = format;
  2393. - c_fix_arg = "#undef SIZE_MAX\n"
  2394. - "#define SIZE_MAX __SIZE_MAX__\n"
  2395. - "#ifdef __INTPTR_MAX__\n"
  2396. - "# undef INTPTR_MAX\n"
  2397. - "# define INTPTR_MAX __INTPTR_MAX__\n"
  2398. - "# undef INTPTR_MIN\n"
  2399. - "# define INTPTR_MIN (-INTPTR_MAX - 1)\n"
  2400. - "#endif\n"
  2401. - "#ifdef __UINTPTR_MAX__\n"
  2402. - "# undef UINTPTR_MAX\n"
  2403. - "# define UINTPTR_MAX __UINTPTR_MAX__\n"
  2404. - "#endif\n";
  2405. - test_text = "#define INTPTR_MAX\n"
  2406. - "#define UINTPTR_MAX\n";
  2407. -};
  2408. -
  2409. -/*
  2410. - * Fix hpux broken ctype macros
  2411. - */
  2412. -fix = {
  2413. - hackname = hpux_ctype_macros;
  2414. - files = ctype.h;
  2415. - select = '((: |\()__SB_masks \? )'
  2416. - '(__SB_masks\[__(alnum|c)\] & _IS)';
  2417. - c_fix = format;
  2418. - c_fix_arg = "%1(int)%3";
  2419. -
  2420. - test_text = ": __SB_masks ? __SB_masks[__alnum] & _ISCNTRL\n"
  2421. - "# define isalpha(__c) (__SB_masks ? __SB_masks[__c] & _IS\n";
  2422. -};
  2423. -
  2424. -/*
  2425. - * hpux errno()
  2426. - */
  2427. -fix = {
  2428. - hackname = hpux_extern_errno;
  2429. - mach = "*-hp-hpux10.*";
  2430. - mach = "*-hp-hpux11.[0-2]*";
  2431. - files = errno.h;
  2432. - select = "^[ \t]*extern int errno;$";
  2433. - c_fix = format;
  2434. - c_fix_arg = "#ifdef __cplusplus\n"
  2435. - "extern \"C\" {\n"
  2436. - "#endif\n"
  2437. - "%0\n"
  2438. - "#ifdef __cplusplus\n"
  2439. - "}\n"
  2440. - "#endif";
  2441. - test_text = " extern int errno;\n";
  2442. -};
  2443. -
  2444. -/*
  2445. - * Fix hpux broken #ifndef _XOPEN_SOURCE_EXTENDED conditional on htonl etc.
  2446. - */
  2447. -fix = {
  2448. - hackname = hpux_htonl;
  2449. - files = netinet/in.h;
  2450. - select = "#ifndef _XOPEN_SOURCE_EXTENDED[ \t]*\n"
  2451. - "(/\\*\n"
  2452. - " \\* Macros for number representation conversion\\.\n"
  2453. - " \\*/\n"
  2454. - "#ifndef ntohl)";
  2455. - c_fix = format;
  2456. - c_fix_arg = "#if 1\n%1";
  2457. -
  2458. - test_text = "#ifndef _XOPEN_SOURCE_EXTENDED\n"
  2459. - "/*\n"
  2460. - " * Macros for number representation conversion.\n"
  2461. - " */\n"
  2462. - "#ifndef ntohl\n"
  2463. - "#define ntohl(x) (x)\n"
  2464. - "#define ntohs(x) (x)\n"
  2465. - "#define htonl(x) (x)\n"
  2466. - "#define htons(x) (x)\n"
  2467. - "#endif\n"
  2468. - "#endif /* ! _XOPEN_SOURCE_EXTENDED */";
  2469. -};
  2470. -
  2471. -/*
  2472. - * These hacks are need in inttypes.h on 11.23 and in stdint.h on 11.31.
  2473. - */
  2474. -fix = {
  2475. - hackname = hpux_imaginary_i;
  2476. - mach = "ia64-hp-hpux11.*";
  2477. - files = complex.h;
  2478. - select = "^[ \t]*#[ \t]*define[ \t]*_Complex_I.*";
  2479. - c_fix = format;
  2480. - c_fix_arg = "#define _Complex_I (__extension__ 1.0iF)";
  2481. - test_text = "#define _Complex_I (0.f+_Imaginary_I)\n";
  2482. -};
  2483. -
  2484. -/*
  2485. - * These hacks are need in inttypes.h on 11.23 and in stdint.h on 11.31.
  2486. - */
  2487. -fix = {
  2488. - hackname = hpux_inttype_int8_t;
  2489. - mach = "*-hp-hpux1[01].*";
  2490. - files = sys/_inttypes.h;
  2491. - select = "^[ \t]*typedef[ \t]*char[ \t]*int(_least){0,1}8_t.*";
  2492. - c_fix = format;
  2493. - c_fix_arg = "typedef signed char int%18_t;";
  2494. - test_text = "typedef char int_least8_t;\n"
  2495. - "typedef char int8_t;\n";
  2496. -};
  2497. -
  2498. -/*
  2499. - * HP-UX long_double
  2500. - */
  2501. -fix = {
  2502. - hackname = hpux_long_double;
  2503. - mach = "*-*-hpux10*";
  2504. - mach = "*-*-hpux11.[012]*";
  2505. - files = stdlib.h;
  2506. - select = "extern[ \t]long_double[ \t]strtold";
  2507. - bypass = "long_double_t";
  2508. - sed = "/^#[ \t]*ifndef _LONG_DOUBLE/,/\\/\\* _LONG_DOUBLE \\*\\//D";
  2509. - sed = "s/long_double/long double/g";
  2510. -
  2511. - test_text = "# ifndef _LONG_DOUBLE\n"
  2512. - "# define _LONG_DOUBLE\n"
  2513. - " typedef struct {\n"
  2514. - " unsigned int word1, word2, word3, word4;\n"
  2515. - " } long_double;\n"
  2516. - "# endif /* _LONG_DOUBLE */\n"
  2517. - "extern long_double strtold(const char *, char **);\n";
  2518. -};
  2519. -
  2520. -/*
  2521. - * We cannot use the above rule on 11.31 because it removes the strtold
  2522. - * definition. ia64 is OK with no hack, PA needs some help.
  2523. - */
  2524. -fix = {
  2525. - hackname = hpux_long_double_2;
  2526. - mach = "hppa*-*-hpux11.3*";
  2527. - files = stdlib.h;
  2528. - select = "#[ \t]*if[ \t]*!defined\\(__ia64\\) \\|\\| "
  2529. - "defined\\(_PROTOTYPES\\) \\|\\| "
  2530. - "defined\\(_LONG_DOUBLE_STRUCT\\)";
  2531. - c_fix = format;
  2532. - c_fix_arg = "# if !defined(_PROTOTYPES) || defined(_LONG_DOUBLE_STRUCT)";
  2533. -
  2534. - test_text = "# if !defined(__ia64) || "
  2535. - "!defined(_PROTOTYPES) || "
  2536. - "defined(_LONG_DOUBLE_STRUCT)\n";
  2537. -};
  2538. -
  2539. -/*
  2540. - * Add missing braces to pthread initializer defines.
  2541. - */
  2542. -fix = {
  2543. - hackname = hpux_pthread_initializers;
  2544. - mach = "*-hp-hpux11.[0-3]*";
  2545. - files = sys/pthread.h;
  2546. - sed = "s@^[ \t]*1, 1, 1, 1,[ \t]*\\\\"
  2547. - "@\t{ 1, 1, 1, 1 },\t\t\t\t\t\t\t\\\\@";
  2548. - sed = "s@^[ \t]*1,[ \t]*\\\\"
  2549. - "@\t{ 1, 0 }@";
  2550. - sed = "/^[ \t]*0$/d";
  2551. - sed = "s@__PTHREAD_MUTEX_VALID, 0"
  2552. - "@{ __PTHREAD_MUTEX_VALID, 0 }@";
  2553. - sed = "s@^[ \t]*0, 0, -1, 0,[ \t]*\\\\"
  2554. - "@\t{ 0, 0, -1, 0 },\t\t\t\t\t\t\\\\@";
  2555. - sed = "s@0, __LWP_MTX_VALID, 0, 1, 1, 1, 1,[ \t]*\\\\"
  2556. - "@{ 0, __LWP_MTX_VALID }, { 0, 1, 1, 1, 1 },\t\t\t\\\\@";
  2557. - sed = "s@^[ \t]*__LWP_MTX_VALID, 0, 1, 1, 1, 1,[ \t]*\\\\"
  2558. - "@\t{ 0, __LWP_MTX_VALID }, { 0, 1, 1, 1, 1 },\t\t\t\\\\@";
  2559. - sed = "s@^[ \t]*0, 0[ \t]*\\\\"
  2560. - "@\t{ 0, 0 }\t\t\t\t\t\t\t\\\\@";
  2561. - sed = "s@__PTHREAD_COND_VALID, 0"
  2562. - "@{ __PTHREAD_COND_VALID, 0 }@";
  2563. - sed = "s@__LWP_COND_VALID, 0,[ \t]*\\\\"
  2564. - "@{ __LWP_COND_VALID, 0 },\t\t\t\t\t\\\\@";
  2565. - sed = "s@__PTHREAD_RWLOCK_VALID, 0"
  2566. - "@{ __PTHREAD_RWLOCK_VALID, 0 }@";
  2567. - sed = "s@__LWP_RWLOCK_VALID, 0,[ \t]*\\\\"
  2568. - "@{ __LWP_RWLOCK_VALID, 0 },\t\t\t\t\t\\\\@";
  2569. - sed = "s@^[ \t]*0, 0, 0, 0, 0, 0, 0[ \t]*\\\\"
  2570. - "@\t{ 0, 0, 0, 0, 0 }, { 0, 0}\t\t\t\t\t\\\\@";
  2571. - test_text = "#define PTHREAD_MUTEX_INITIALIZER {\t\t\t\t\t\\\\\n"
  2572. - "\t__PTHREAD_MUTEX_VALID, 0,\t\t\t\t\t\\\\\n"
  2573. - "\t(PTHREAD_MUTEX_DEFAULT | PTHREAD_PROCESS_PRIVATE),\t\t\\\\\n"
  2574. - "\t__SPNLCK_INITIALIZER,\t\t\t\t\t\t\\\\\n"
  2575. - "\t0, 0, -1, 0,\t\t\t\t\t\t\t\\\\\n"
  2576. - "\t0, __LWP_MTX_VALID, 0, 1, 1, 1, 1,\t\t\t\t\\\\\n"
  2577. - "\t0, 0\t\t\t\t\t\t\t\t\\\\\n"
  2578. - "}\n";
  2579. -};
  2580. -
  2581. -/*
  2582. - * Wrap spu_info in ifdef _KERNEL. GCC cannot handle an array of unknown
  2583. - * type and mpinfou is only defined when _KERNEL is set.
  2584. - */
  2585. -fix = {
  2586. - hackname = hpux_spu_info;
  2587. - mach = "*-hp-hpux*";
  2588. - /*
  2589. - * It is tempting to omit the first "files" entry. Do not.
  2590. - * The testing machinery will take the first "files" entry as the name
  2591. - * of a test file to play with. It would be a nuisance to have a directory
  2592. - * with the name "*".
  2593. - */
  2594. - files = "ia64/sys/getppdp.h";
  2595. - files = "*/sys/getppdp.h";
  2596. - select = "^.*extern.*spu_info.*";
  2597. -
  2598. - c_fix = format;
  2599. - c_fix_arg = "#ifdef _KERNEL\n%0\n#endif";
  2600. -
  2601. - test_text = "extern union mpinfou spu_info[];";
  2602. -};
  2603. -
  2604. -/*
  2605. - * These hacks are need in inttypes.h on 11.23 and in stdint.h on 11.31.
  2606. - */
  2607. -fix = {
  2608. - hackname = hpux_stdint_least_fast;
  2609. - mach = "*-hp-hpux11.2*";
  2610. - files = stdint-hpux11.h, stdint.h;
  2611. - select =
  2612. - "^[ \t]*#[ \t]*define[ \t]+UINT_(LEAST|FAST)64_MAX[ \t]+ULLONG_MAX";
  2613. - c_fix = format;
  2614. - c-fix-arg = "# define UINT_%164_MAX __UINT64_MAX__";
  2615. - test-text = "# define UINT_FAST64_MAX ULLONG_MAX\n"
  2616. - "# define UINT_LEAST64_MAX ULLONG_MAX\n";
  2617. -};
  2618. -
  2619. -/*
  2620. - * Add noreturn attribute to longjmp declarations in hpux <setjmp.h>
  2621. - */
  2622. -fix = {
  2623. - hackname = hpux_longjmp;
  2624. - mach = "*-hp-hpux*";
  2625. - files = setjmp.h;
  2626. - select = "^[ \t]*extern[ \t]+void[ \t]+.*longjmp[ \t]*\(__\\(\\(.*int\\)\\)|\\(.*int\\)|\\(\\)\)";
  2627. -
  2628. - c_fix = format;
  2629. - c_fix_arg = "%0 __attribute__ ((__noreturn__))";
  2630. -
  2631. - test_text = 'extern void longjmp __((jmp_buf, int));';
  2632. -};
  2633. -
  2634. -/*
  2635. - * Fix hpux10.20 <sys/time.h> to avoid invalid forward decl
  2636. - */
  2637. -fix = {
  2638. - hackname = hpux_systime;
  2639. - files = sys/time.h;
  2640. - select = "^extern struct sigevent;";
  2641. -
  2642. - c_fix = format;
  2643. - c_fix_arg = "struct sigevent;";
  2644. -
  2645. - test_text = 'extern struct sigevent;';
  2646. -};
  2647. -
  2648. -/*
  2649. - * Fix glibc definition of HUGE_VAL in terms of hex floating point constant
  2650. - */
  2651. -fix = {
  2652. - hackname = huge_val_hex;
  2653. - files = bits/huge_val.h, '*/bits/huge_val.h';
  2654. - select = "^#[ \t]*define[ \t]*HUGE_VAL[ \t].*0x1\\.0p.*";
  2655. - bypass = "__builtin_huge_val";
  2656. -
  2657. - c_fix = format;
  2658. - c_fix_arg = "#define HUGE_VAL (__builtin_huge_val())\n";
  2659. -
  2660. - test_text = "# define HUGE_VAL\t(__extension__ 0x1.0p2047)";
  2661. -};
  2662. -
  2663. -/*
  2664. - * Fix glibc definition of HUGE_VALF in terms of hex floating point constant
  2665. - */
  2666. -fix = {
  2667. - hackname = huge_valf_hex;
  2668. - files = bits/huge_val.h, '*/bits/huge_val.h';
  2669. - select = "^#[ \t]*define[ \t]*HUGE_VALF[ \t].*0x1\\.0p.*";
  2670. - bypass = "__builtin_huge_valf";
  2671. -
  2672. - c_fix = format;
  2673. - c_fix_arg = "#define HUGE_VALF (__builtin_huge_valf())\n";
  2674. -
  2675. - test_text = "# define HUGE_VALF (__extension__ 0x1.0p255f)";
  2676. -};
  2677. -
  2678. -/*
  2679. - * Fix glibc definition of HUGE_VALL in terms of hex floating point constant
  2680. - */
  2681. -fix = {
  2682. - hackname = huge_vall_hex;
  2683. - files = bits/huge_val.h, '*/bits/huge_val.h';
  2684. - select = "^#[ \t]*define[ \t]*HUGE_VALL[ \t].*0x1\\.0p.*";
  2685. - bypass = "__builtin_huge_vall";
  2686. -
  2687. - c_fix = format;
  2688. - c_fix_arg = "#define HUGE_VALL (__builtin_huge_vall())\n";
  2689. -
  2690. - test_text = "# define HUGE_VALL (__extension__ 0x1.0p32767L)";
  2691. -};
  2692. -
  2693. -/*
  2694. * Fix return type of abort and free
  2695. */
  2696. fix = {
  2697. @@ -2974,25 +326,17 @@
  2698. "}; /* mumbled struct */\n";
  2699. };
  2700.  
  2701. -/*
  2702. - * Non-traditional "const" declaration in Irix's limits.h.
  2703. - */
  2704. -fix = {
  2705. - hackname = irix_limits_const;
  2706. - files = fixinc-test-limits.h, limits.h;
  2707. - select = "^extern const ";
  2708. - c_fix = format;
  2709. - c_fix_arg = "extern __const ";
  2710. - test_text = "extern const char limit; /* test limits */";
  2711. -};
  2712. +/* REINTRODUCE */
  2713.  
  2714. /*
  2715. - * IRIX 5.x's stdio.h declares some functions that take a va_list as
  2716. + * IRIX 5.x's stdio.h and IRIX 6.5's internal/stdio_core.h declare
  2717. + * some functions that take a va_list as
  2718. * taking char *. However, GCC uses void * for va_list, so
  2719. * calling vfprintf with a va_list fails in C++. */
  2720. fix = {
  2721. hackname = irix_stdio_va_list;
  2722. files = stdio.h;
  2723. + files = internal/stdio_core.h;
  2724.  
  2725. select = '/\* va_list \*/ char \*';
  2726. c_fix = format;
  2727. @@ -3002,83 +346,276 @@
  2728. };
  2729.  
  2730. /*
  2731. - * These files in Sun OS 4.x and ARM/RISCiX and BSD4.3
  2732. - * use / * * / to concatenate tokens.
  2733. + * IRIX 6.5.1[89] <internal/sgimacros.h> unconditionally defines
  2734. + * __restrict as restrict iff __c99. This is wrong for C++, which
  2735. + * needs many C99 features, but only supports __restrict.
  2736. */
  2737. fix = {
  2738. - hackname = kandr_concat;
  2739. - files = "sparc/asm_linkage.h";
  2740. - files = "sun*/asm_linkage.h";
  2741. - files = "arm/as_support.h";
  2742. - files = "arm/mc_type.h";
  2743. - files = "arm/xcb.h";
  2744. - files = "dev/chardefmac.h";
  2745. - files = "dev/ps_irq.h";
  2746. - files = "dev/screen.h";
  2747. - files = "dev/scsi.h";
  2748. - files = "sys/tty.h";
  2749. - files = "Xm.acorn/XmP.h";
  2750. - files = bsd43/bsd43_.h;
  2751. - select = '/\*\*/';
  2752. - c_fix = format;
  2753. - c_fix_arg = '##';
  2754. - test_text = "#define __CONCAT__(a,b) a/**/b";
  2755. + hackname = irix___restrict;
  2756. + files = internal/sgimacros.h;
  2757. + select = "(#ifdef __c99\n)(#[ \t]*define __restrict restrict)";
  2758. +
  2759. + mach = "mips-sgi-irix6.5";
  2760. + c_fix = format;
  2761. + c_fix_arg = "%1"
  2762. + "# ifndef __cplusplus\n%2\n# endif";
  2763. +
  2764. + test_text = "#ifdef __c99\n# define __restrict restrict";
  2765. };
  2766.  
  2767. /*
  2768. - * The /usr/include/sys/ucontext.h on ia64-*linux-gnu systems defines
  2769. - * an _SC_GR0_OFFSET macro using an idiom that isn't a compile time
  2770. - * constant on recent versions of g++.
  2771. - */
  2772. -fix = {
  2773. - hackname = linux_ia64_ucontext;
  2774. - files = "sys/ucontext.h";
  2775. - mach = "ia64-*-linux*";
  2776. - select = '\(\(\(char \*\) &\(\(struct sigcontext \*\) 0\)'
  2777. - '->sc_gr\[0\]\) - \(char \*\) 0\)';
  2778. - c_fix = format;
  2779. - c_fix_arg = "__builtin_offsetof \(struct sigcontext, sc_gr[0]\)";
  2780. - test_text = "# define _SC_GR0_OFFSET\t\\\\\n"
  2781. - "\t(((char *) &((struct sigcontext *) 0)->sc_gr[0]) - (char *) 0)\n";
  2782. + * IRIX 6.5.22 <internal/math_core.h> uses the SGI c99 __generic() intrinsic
  2783. + * to define the fpclasify, isfinite, isinf, isnan, isnormal and signbit
  2784. + * functions.
  2785. + *
  2786. + * This was probably introduced around IRIX 6.5.18
  2787. + */
  2788. +fix = {
  2789. + hackname = irix___generic1;
  2790. + files = internal/math_core.h;
  2791. + mach = "mips-sgi-irix6.5";
  2792. + select = "#define ([a-z]+)\\(x\\) *__generic.*";
  2793. +
  2794. + c_fix = format;
  2795. + c_fix_arg = "extern int %1(double);\n"
  2796. + "extern int %1f(float);\n"
  2797. + "extern int %1l(long double);\n"
  2798. + "#if !defined(__cplusplus)\n"
  2799. + "#define %1(x) (sizeof(x) == sizeof(double) ? _%1(x) \\\n"
  2800. + " : sizeof(x) == sizeof(float) ? _%1f(x) \\\n"
  2801. + " : _%1l(x))\n"
  2802. + "#else\n"
  2803. + "namespace std\n"
  2804. + "{\n"
  2805. + " inline int %1(double x) { return _%1(x); };\n"
  2806. + " inline int %1f(float x) { return _%1f(x); };\n"
  2807. + " inline int %1l(long double x) { return _%1l(x); };\n"
  2808. + "}\n"
  2809. + "#endif\n";
  2810. +
  2811. + test_text =
  2812. + "#define isnan(x) __generic(x,,, _isnan, _isnanf, _isnanl,,,)(x)\n";
  2813. };
  2814.  
  2815. -/*
  2816. - * Remove header file warning from sys/time.h. Autoconf's
  2817. - * AC_HEADER_TIME recommends to include both sys/time.h and time.h
  2818. - * which causes warning on LynxOS. Remove the warning.
  2819. - */
  2820. +/* Likewise <internal/math_core.h> on IRIX 6.5.19 and later uses the SGI
  2821. + compiler's __generic intrinsic to define isgreater, isgreaterequal,
  2822. + isless, islessequal, islessgreater and isunordered functions. */
  2823. fix = {
  2824. - hackname = lynxos_no_warning_in_sys_time_h;
  2825. - files = sys/time.h;
  2826. - select = "#warning[ \t]+Using <time.h> instead of <sys/time.h>";
  2827. + hackname = irix___generic2;
  2828. + files = internal/math_core.h;
  2829. + mach = "mips-sgi-irix6.5";
  2830. + select = "#define ([a-z]+)\\(x,y\\) *__generic.*";
  2831. +
  2832. c_fix = format;
  2833. - c_fix_arg = "";
  2834. - test_text = "#warning Using <time.h> instead of <sys/time.h>";
  2835. + c_fix_arg = "#define %1(x,y) \\\n"
  2836. + " ((sizeof(x)<=4 && sizeof(y)<=4) ? _%1f(x,y) \\\n"
  2837. + " : (sizeof(x)<=8 && sizeof(y)<=8) ? _%1(x,y) \\\n"
  2838. + " : _%1l(x,y))\n";
  2839. +
  2840. + test_text =
  2841. + "#define isless(x,y) __generic(x,y,, _isless, _islessf, _islessl,,,)(x,y)";
  2842. };
  2843.  
  2844. -/*
  2845. - * Add missing declaration for putenv.
  2846. +
  2847. +/*
  2848. + * IRIX 6.5 complex.h defines _Complex_I and _Imaginary_I in terms of __I__,
  2849. + * which is a MIPSpro compiler builtin. Remove _Imaginary_I and imaginary
  2850. + * definitions which are not supported by GCC.
  2851. */
  2852. fix = {
  2853. - hackname = lynxos_missing_putenv;
  2854. - mach = '*-*-lynxos*';
  2855. - files = stdlib.h;
  2856. - bypass = 'putenv[ \t]*\\(';
  2857. - select = "extern char \\*getenv[ \t]*_AP\\(\\(const char \\*\\)\\);";
  2858. + hackname = irix_complex;
  2859. + mach = "mips-sgi-irix6.5";
  2860. + files = complex.h;
  2861. + select = "#define[ \t]_Complex_I[ \t]\\(\\(float[ \t]_Complex\\)[ \t]\\(__I__\\)\\)";
  2862. + sed = "s/#define[ \t]_Complex_I[ \t]((float[ \t]_Complex)[ \t](__I__))/"
  2863. + "#define _Complex_I (__extension__ 1.0iF)/";
  2864. + sed = "/#define[ \t]imaginary[ \t]_Imaginary/d";
  2865. + sed = "/#define[ \t]_Imaginary_I/d";
  2866. + sed = "s/#define[ \t]I[ \t]_Imaginary_I/#define I _Complex_I/";
  2867. + test_text = "#define _Complex_I ((float _Complex) (__I__))\n"
  2868. + "#define imaginary _Imaginary\n"
  2869. + "// #define _Imaginary_I ((float _Imaginary) 1)\n"
  2870. + "#define _Imaginary_I __I__\n"
  2871. + "#define I _Imaginary_I";
  2872. +};
  2873. +
  2874. +/*
  2875. + * Non-traditional "const" declaration in Irix's limits.h.
  2876. + */
  2877. +fix = {
  2878. + hackname = irix_limits_const;
  2879. + files = fixinc-test-limits.h, limits.h;
  2880. + select = "^extern const ";
  2881. + c_fix = format;
  2882. + c_fix_arg = "extern __const ";
  2883. + test_text = "extern const char limit; /* test limits */";
  2884. +};
  2885. +
  2886. +/*
  2887. + * IRIX 6.5 PTHREAD_*_INITIALIZER need an additional level of braces in
  2888. + * <pthread.h>.
  2889. + */
  2890. +fix = {
  2891. + hackname = irix_pthread_init;
  2892. + files = pthread.h;
  2893. + select = "^(#define[ \t]+PTHREAD_.*_INITIALIZER[ \t]+)(\\{ 0 \\})";
  2894. +
  2895. + mach = "mips-sgi-irix6.5";
  2896. + c_fix = format;
  2897. + c_fix_arg = "%1{ %2 }";
  2898. + test_text = "#define PTHREAD_MUTEX_INITIALIZER { 0 }\n"
  2899. + "#define PTHREAD_COND_INITIALIZER { 0 }\n"
  2900. + "#define PTHREAD_RWLOCK_INITIALIZER { 0 }";
  2901. +};
  2902. +
  2903. +
  2904. +/*
  2905. + * IRIX 6.5.1[78] <sys/socket.h> has a broken definition of socklen_t.
  2906. + * Various socket function prototypes use different types instead,
  2907. + * depending on the API in use (BSD, XPG4/5), but the socklen_t
  2908. + * definition doesn't reflect this (SGI Bug Id 864477, fixed in
  2909. + * IRIX 6.5.19).
  2910. + */
  2911. +fix = {
  2912. + hackname = irix_socklen_t;
  2913. + files = sys/socket.h;
  2914. + select = "(#define _SOCKLEN_T\n)(typedef u_int32_t socklen_t;)";
  2915. +
  2916. + mach = "mips-sgi-irix6.5";
  2917. c_fix = format;
  2918. - c_fix_arg = "%0\n"
  2919. - "extern int putenv _AP((char *));";
  2920. - c_fix_arg = "extern char \\*getenv[ \t]*_AP\\(\\(const char \\*\\)\\);";
  2921. - test_text = "extern char *getenv _AP((const char *));";
  2922. + c_fix_arg = "%1"
  2923. + "#if _NO_XOPEN4 && _NO_XOPEN5\n"
  2924. + "typedef int socklen_t;\n"
  2925. + "#else\n"
  2926. + "%2\n"
  2927. + "#endif /* _NO_XOPEN4 && _NO_XOPEN5 */";
  2928. +
  2929. + test_text = "#define _SOCKLEN_T\ntypedef u_int32_t socklen_t;";
  2930. };
  2931.  
  2932. /*
  2933. - * Fix BSD machine/ansi.h to use __builtin_va_list to define _BSD_VA_LIST_.
  2934. - *
  2935. - * On NetBSD, machine is a symbolic link to an architecture specific
  2936. - * directory name, so we can't match a specific file name here.
  2937. + * IRIX 6.5 <stdint.h> only works with ISO C99 and errors out
  2938. + * otherwise.
  2939. */
  2940. fix = {
  2941. + hackname = irix_stdint_c99_mode;
  2942. + files = stdint.h;
  2943. + select = "(#ifndef __c99\n)(#error This header file is to be used only for c99 mode compilations)";
  2944. +
  2945. + mach = "mips-sgi-irix6.5";
  2946. + c_fix = format;
  2947. + c_fix_arg = "#if 0\n"
  2948. + "%2";
  2949. + test_text =
  2950. + "#ifndef __c99\n#error This header file is to be used only for c99 mode compilations\n#else";
  2951. +};
  2952. +
  2953. +
  2954. +/*
  2955. + * IRIX 6.5 <stdint.h> has some *_MIN/MAX constants whose types don't
  2956. + * match the corresponding types, as required by ISO C99.
  2957. + */
  2958. +fix = {
  2959. + hackname = irix_stdint_c99_types;
  2960. + files = stdint-irix65.h, stdint.h;
  2961. + mach = "mips-sgi-irix6.5";
  2962. + sed = "s@^#define INT64_MIN.*(-0x7fffffffffffffff - 1)$@"
  2963. + "#define INT64_MIN (-0x7fffffffffffffffLL - 1)@";
  2964. + sed = "s@^#define INT64_MAX.*0x7fffffffffffffff$@"
  2965. + "#define INT64_MAX 0x7fffffffffffffffLL@";
  2966. + sed = "s@^#define UINT32_MAX.*0xffffffff$@"
  2967. + "#define UINT32_MAX 0xffffffffU@";
  2968. + sed = "s@^#define UINT64_MAX.*0xffffffffffffffff$@"
  2969. + "#define UINT64_MAX 0xffffffffffffffffULL@";
  2970. + sed = "s@^#define INTPTR_MIN.*INT32_MIN$@"
  2971. + "#define INTPTR_MIN (-0x7fffffffL - 1)@";
  2972. + sed = "s@^#define INTPTR_MAX.*INT32_MAX$@"
  2973. + "#define INTPTR_MAX 0x7fffffffL@";
  2974. + sed = "s@^#define UINTPTR_MAX.*UINT32_MAX$@"
  2975. + "#define UINTPTR_MAX 0xffffffffUL@";
  2976. + sed = "s@^#define INTPTR_MIN.*INT64_MIN@"
  2977. + "#define INTPTR_MIN (-0x7fffffffffffffffL - 1)@";
  2978. + sed = "s@^#define INTPTR_MAX.*INT64_MAX$@"
  2979. + "#define INTPTR_MAX 0x7fffffffffffffffL@";
  2980. + sed = "s@^#define UINTPTR_MAX.*UINT64_MAX$@"
  2981. + "#define UINTPTR_MAX 0xffffffffffffffffUL@";
  2982. + sed = "s@^#define PTRDIFF_MIN.*INT64_MIN$@"
  2983. + "#define PTRDIFF_MIN (-0x7fffffffffffffffL - 1)@";
  2984. + sed = "s@^#define PTRDIFF_MAX.*INT64_MAX$@"
  2985. + "#define PTRDIFF_MAX 0x7fffffffffffffffL@";
  2986. + sed = "s@^#define SIZE_MAX.*UINT64_MAX$@"
  2987. + "#define SIZE_MAX 0xffffffffffffffffUL@";
  2988. + test_text = "#define INT64_MIN (-0x7fffffffffffffff - 1)\n"
  2989. + "#define INT64_MAX 0x7fffffffffffffff\n"
  2990. + "#define UINT32_MAX 0xffffffff\n"
  2991. + "#define UINT64_MAX 0xffffffffffffffff\n"
  2992. + "#define INTPTR_MIN INT32_MIN\n"
  2993. + "#define INTPTR_MAX INT32_MAX\n"
  2994. + "#define UINTPTR_MAX UINT32_MAX\n"
  2995. + "#define INTPTR_MIN INT64_MIN\n"
  2996. + "#define INTPTR_MAX INT64_MAX\n"
  2997. + "#define UINTPTR_MAX UINT64_MAX\n"
  2998. + "#define PTRDIFF_MIN INT64_MIN\n"
  2999. + "#define PTRDIFF_MAX INT64_MAX\n"
  3000. + "#define SIZE_MAX UINT64_MAX";
  3001. +};
  3002. +
  3003. +
  3004. +/*
  3005. + * IRIX 6.5 <stdint.h> uses casts in some macros which cannot thus be used
  3006. + * in preprocessor tests, although ISO C99 requires this.
  3007. + */
  3008. +fix = {
  3009. + hackname = irix_stdint_c99_macros;
  3010. + files = stdint-irix65.h, stdint.h;
  3011. + mach = "mips-sgi-irix6.5";
  3012. + sed = "s@^#define INT8_C(x).*int.*_t.*$@#define INT8_C(x) (x)@";
  3013. + sed = "s@^#define INT16_C(x).*int.*_t.*$@#define INT16_C(x) (x)@";
  3014. + sed = "s@^#define INT32_C(x).*int.*_t.*$@#define INT32_C(x) (x)@";
  3015. + sed = "s@^#define INT64_C(x).*int.*_t.*$@#define INT64_C(x) (x ## LL)@";
  3016. + sed = "s@^#define UINT8_C(x).*int.*_t.*$@#define UINT8_C(x) (x)@";
  3017. + sed = "s@^#define UINT16_C(x).*int.*_t.*$@#define UINT16_C(x) (x)@";
  3018. + sed = "s@^#define UINT32_C(x).*int.*_t.*$@#define UINT32_C(x) (x ## U)@";
  3019. + sed = "s@^#define UINT64_C(x).*int.*_t.*$@#define UINT64_C(x) (x ## ULL)@";
  3020. + sed = "s@^#define INTMAX_C(x).*int.*_t.*$@#define INTMAX_C(x) (x ## LL)@";
  3021. + sed = "s@^#define UINTMAX_C(x).*int.*_t.*$@#define UINTMAX_C(x) (x ## ULL)@";
  3022. + test_text = "#define INT8_C(x) (int_least8_t)(x)\n"
  3023. + "#define INT16_C(x) (int_least16_t)(x)\n"
  3024. + "#define INT32_C(x) (int_least32_t)(x)\n"
  3025. + "#define INT64_C(x) (int_least64_t)(x)\n"
  3026. + "#define UINT8_C(x) (uint_least8_t)(x)\n"
  3027. + "#define UINT16_C(x) (uint_least16_t)(x)\n"
  3028. + "#define UINT32_C(x) (uint_least32_t)(x)\n"
  3029. + "#define UINT64_C(x) (uint_least64_t)(x)\n"
  3030. + "#define INTMAX_C(x) (intmax_t)(x)\n"
  3031. + "#define UINTMAX_C(x) (uintmax_t)(x)";
  3032. +};
  3033. +
  3034. +
  3035. +/*
  3036. + * IRIX 6.5.19 <internal/wchar_core.h> provides the XPG4 variant of
  3037. + * wcsftime by default. ISO C99 requires the XPG5 variant instead.
  3038. + */
  3039. +fix = {
  3040. + hackname = irix_wcsftime;
  3041. + files = internal/wchar_core.h;
  3042. + select = "#if _NO_XOPEN5\n(extern size_t[ \t]+wcsftime.*const char \*.*)";
  3043. +
  3044. + mach = "mips-sgi-irix6.5";
  3045. + c_fix = format;
  3046. + c_fix_arg = "#if _NO_XOPEN5 && !defined(__c99)\n%1";
  3047. +
  3048. + test_text = "#if _NO_XOPEN5\n"
  3049. + "extern size_t wcsftime(wchar_t *, "
  3050. + "__SGI_LIBC_NAMESPACE_QUALIFIER size_t, const char *, "
  3051. + "const struct tm *);";
  3052. +};
  3053. +
  3054. +
  3055. +
  3056. +/* END REINTRODUCE */
  3057. +
  3058. +fix = {
  3059. hackname = machine_ansi_h_va_list;
  3060. select = "define[ \t]+_BSD_VA_LIST_[ \t]";
  3061. bypass = '__builtin_va_list';
  3062. @@ -3091,19 +628,6 @@
  3063. };
  3064.  
  3065. /*
  3066. - * Fix non-ansi machine name defines
  3067. - */
  3068. -fix = {
  3069. - hackname = machine_name;
  3070. - c_test = machine_name;
  3071. - c_fix = machine_name;
  3072. -
  3073. - test_text = "/* MACH_DIFF: */\n"
  3074. - "#if defined( i386 ) || defined( sparc ) || defined( vax )"
  3075. - "\n/* no uniform test, so be careful :-) */";
  3076. -};
  3077. -
  3078. -/*
  3079. * Some math.h files define struct exception (it's in the System V
  3080. * Interface Definition), which conflicts with the class exception defined
  3081. * in the C++ file std/stdexcept.h. We redefine it to __math_exception.
  3082. @@ -3188,61 +712,6 @@
  3083. };
  3084.  
  3085. /*
  3086. - * Some versions of NetBSD don't expect the C99 inline semantics.
  3087. - */
  3088. -fix = {
  3089. - hackname = netbsd_c99_inline_1;
  3090. - mach = "*-*-netbsd*";
  3091. - files = signal.h;
  3092. - select = "extern __inline int";
  3093. -
  3094. - c_fix = format;
  3095. - c_fix_arg = "extern\n"
  3096. - "#ifdef __GNUC_STDC_INLINE__\n"
  3097. - "__attribute__((__gnu_inline__))\n"
  3098. - "#endif\n"
  3099. - "__inline int";
  3100. -
  3101. - test_text = "extern __inline int\nsigaddset(sigset_t *set, int signo)\n{}";
  3102. -};
  3103. -
  3104. -/*
  3105. - * netbsd_c99_inline_2
  3106. - */
  3107. -fix = {
  3108. - hackname = netbsd_c99_inline_2;
  3109. - mach = "*-*-netbsd*";
  3110. - files = signal.h;
  3111. - select = "#define _SIGINLINE extern __inline";
  3112. -
  3113. - c_fix = format;
  3114. - c_fix_arg = <<- _EOArg_
  3115. - #ifdef __GNUC_STDC_INLINE__
  3116. - #define _SIGINLINE extern __attribute__((__gnu_inline__)) __inline
  3117. - #else
  3118. - %0
  3119. - #endif
  3120. - _EOArg_;
  3121. -
  3122. - test_text = "#define _SIGINLINE extern __inline";
  3123. -};
  3124. -
  3125. -/*
  3126. - * NetBSD has a semicolon after the ending '}' for some extern "C".
  3127. - */
  3128. -fix = {
  3129. - hackname = netbsd_extra_semicolon;
  3130. - mach = "*-*-netbsd*";
  3131. - files = sys/cdefs.h;
  3132. - select = "#define[ \t]*__END_DECLS[ \t]*};";
  3133. -
  3134. - c_fix = format;
  3135. - c_fix_arg = "#define __END_DECLS }";
  3136. -
  3137. - test_text = "#define __END_DECLS };";
  3138. -};
  3139. -
  3140. -/*
  3141. * newlib's stdint.h has several failures to conform to C99. The fix
  3142. * for these removed a comment that can be matched to identify unfixed
  3143. * versions.
  3144. @@ -3309,73 +778,6 @@
  3145. "/** Macros for minimum-width integer constant expressions */";
  3146. };
  3147.  
  3148. -/*
  3149. - * NeXT 3.2 adds const prefix to some math functions.
  3150. - * These conflict with the built-in functions.
  3151. - */
  3152. -fix = {
  3153. - hackname = next_math_prefix;
  3154. - files = ansi/math.h;
  3155. - select = "^extern[ \t]+double[ \t]+__const__[ \t]";
  3156. -
  3157. - c_fix = format;
  3158. - c_fix_arg = "extern double %1(";
  3159. - c_fix_arg = "^extern[ \t]+double[ \t]+__const__[ \t]+([a-z]+)\\(";
  3160. -
  3161. - test_text = "extern\tdouble\t__const__\tmumble();";
  3162. -};
  3163. -
  3164. -/*
  3165. - * NeXT 3.2 uses the word "template" as a parameter for some
  3166. - * functions. GCC reports an invalid use of a reserved key word
  3167. - * with the built-in functions.
  3168. - */
  3169. -fix = {
  3170. - hackname = next_template;
  3171. - files = bsd/libc.h;
  3172. - select = "[ \t]template\\)";
  3173. -
  3174. - c_fix = format;
  3175. - c_fix_arg = "(%1)";
  3176. - c_fix_arg = "\\(([^)]*)[ \t]template\\)";
  3177. - test_text = "extern mumble( char * template); /* fix */";
  3178. -};
  3179. -
  3180. -/*
  3181. - * NeXT 3.2 includes the keyword volatile in the abort() and exit()
  3182. - * function prototypes. That conflicts with the built-in functions.
  3183. - */
  3184. -fix = {
  3185. - hackname = next_volitile;
  3186. - files = ansi/stdlib.h;
  3187. - select = "^extern[ \t]+volatile[ \t]+void[ \t]";
  3188. -
  3189. - c_fix = format;
  3190. - c_fix_arg = "extern void %1(";
  3191. - c_fix_arg = "^extern[ \t]+volatile[ \t]+void[ \t]+(exit|abort)\\(";
  3192. -
  3193. - test_text = "extern\tvolatile\tvoid\tabort();";
  3194. -};
  3195. -
  3196. -/*
  3197. - * NeXT 2.0 defines 'int wait(union wait*)', which conflicts with Posix.1.
  3198. - * Note that version 3 of the NeXT system has wait.h in a different directory,
  3199. - * so that this code won't do anything. But wait.h in version 3 has a
  3200. - * conditional, so it doesn't need this fix. So everything is okay.
  3201. - */
  3202. -fix = {
  3203. - hackname = next_wait_union;
  3204. - files = sys/wait.h;
  3205. -
  3206. - select = 'wait\(union wait';
  3207. - c_fix = format;
  3208. - c_fix_arg = "wait(void";
  3209. - test_text = "extern pid_d wait(union wait*);";
  3210. -};
  3211. -
  3212. -/*
  3213. - * a missing semi-colon at the end of the nodeent structure definition.
  3214. - */
  3215. fix = {
  3216. hackname = nodeent_syntax;
  3217. files = netdnet/dnetdb.h;
  3218. @@ -3385,44 +787,6 @@
  3219. test_text = "char *na_addr\t";
  3220. };
  3221.  
  3222. -/*
  3223. - * Fix OpenBSD's NULL definition.
  3224. - */
  3225. -fix = {
  3226. - hackname = openbsd_null_definition;
  3227. - mach = "*-*-openbsd*";
  3228. - files = locale.h, stddef.h, stdio.h, string.h,
  3229. - time.h, unistd.h, wchar.h, sys/param.h;
  3230. - select = "__GNUG__";
  3231. - c_fix = format;
  3232. - c_fix_arg = "#ifndef NULL\n"
  3233. - "#ifdef __cplusplus\n"
  3234. - "#ifdef __GNUG__\n"
  3235. - "#define NULL\t__null\n"
  3236. - "#else\t /* ! __GNUG__ */\n"
  3237. - "#define NULL\t0L\n"
  3238. - "#endif\t /* __GNUG__ */\n"
  3239. - "#else\t /* ! __cplusplus */\n"
  3240. - "#define NULL\t((void *)0)\n"
  3241. - "#endif\t /* __cplusplus */\n"
  3242. - "#endif\t /* !NULL */";
  3243. -
  3244. - c_fix_arg = "^#ifndef[ \t]*NULL\n"
  3245. - "^#ifdef[ \t]*__GNUG__\n"
  3246. - "^#define[ \t]*NULL[ \t]*__null\n"
  3247. - "^#else\n"
  3248. - "^#define[ \t]*NULL[ \t]*0L\n"
  3249. - "^#endif\n"
  3250. - "^#endif";
  3251. - test_text =
  3252. - "#ifndef NULL\n"
  3253. - "#ifdef __GNUG__\n"
  3254. - "#define NULL __null\n"
  3255. - "#else\n"
  3256. - "#define NULL 0L\n"
  3257. - "#endif\n"
  3258. - "#endif\n";
  3259. -};
  3260.  
  3261. /*
  3262. * obstack.h used casts as lvalues.
  3263. @@ -3448,79 +812,6 @@
  3264. test_text = "*((void **) (h)->next_free)++ = (aptr)";
  3265. };
  3266.  
  3267. -/*
  3268. - * Fix OpenBSD's va_start define.
  3269. - */
  3270. -fix = {
  3271. - hackname = openbsd_va_start;
  3272. - mach = "*-*-openbsd*";
  3273. - files = stdarg.h;
  3274. - select = '__builtin_stdarg_start';
  3275. - c_fix = format;
  3276. - c_fix_arg = __builtin_va_start;
  3277. -
  3278. - test_text = "#define va_start(v,l) __builtin_stdarg_start((v),l)";
  3279. -};
  3280. -
  3281. -/*
  3282. - * sys/lc_core.h on some versions of OSF1/4.x pollutes the namespace by
  3283. - * defining regex.h related types. This causes libg++ build and usage
  3284. - * failures. Fixing this correctly requires checking and modifying 3 files.
  3285. - */
  3286. -fix = {
  3287. - hackname = osf_namespace_a;
  3288. - files = reg_types.h;
  3289. - files = sys/lc_core.h;
  3290. - test = " -r reg_types.h";
  3291. - test = " -r sys/lc_core.h";
  3292. - test = " -n \"`grep '} regex_t;' reg_types.h`\"";
  3293. - test = " -z \"`grep __regex_t regex.h`\"";
  3294. -
  3295. - c_fix = format;
  3296. - c_fix_arg = "__%0";
  3297. - c_fix_arg = "reg(ex|off|match)_t";
  3298. -
  3299. - test_text = "`touch sys/lc_core.h`"
  3300. - "typedef struct {\n int stuff, mo_suff;\n} regex_t;\n"
  3301. - "extern regex_t re;\n"
  3302. - "extern regoff_t ro;\n"
  3303. - "extern regmatch_t rm;\n";
  3304. -};
  3305. -
  3306. -fix = {
  3307. - hackname = osf_namespace_c;
  3308. - files = regex.h;
  3309. - test = " -r reg_types.h";
  3310. - test = " -r sys/lc_core.h";
  3311. - test = " -n \"`grep '} regex_t;' reg_types.h`\"";
  3312. - test = " -z \"`grep __regex_t regex.h`\"";
  3313. -
  3314. - select = "#include <reg_types\.h>.*";
  3315. - c_fix = format;
  3316. - c_fix_arg = "%0\n"
  3317. - "typedef __regex_t\tregex_t;\n"
  3318. - "typedef __regoff_t\tregoff_t;\n"
  3319. - "typedef __regmatch_t\tregmatch_t;";
  3320. -
  3321. - test_text = "#include <reg_types.h>";
  3322. -};
  3323. -
  3324. -/*
  3325. - * On broken glibc-2.3.3 systems an array of incomplete structures is
  3326. - * passed to __sigsetjmp. Fix that to take a pointer instead.
  3327. - */
  3328. -fix = {
  3329. - hackname = pthread_incomplete_struct_argument;
  3330. - files = pthread.h;
  3331. - select = "struct __jmp_buf_tag";
  3332. - c_fix = format;
  3333. - c_fix_arg = "%1 *%2%3";
  3334. - c_fix_arg = "^(extern int __sigsetjmp \\(struct __jmp_buf_tag) "
  3335. - "(__env)\\[1\\](.*)$";
  3336. - test_text = "extern int __sigsetjmp (struct __jmp_buf_tag __env[1], "
  3337. - "int __savemask);";
  3338. -};
  3339. -
  3340. /*
  3341. * Fix return type of fread and fwrite on sysV68
  3342. */
  3343. @@ -3561,611 +852,6 @@
  3344. "\t(*__extension__((u_int32_t*)(buf))++ = (long)htonl((u_long)(v)))";
  3345. };
  3346.  
  3347. -/*
  3348. - * function class(double x) conflicts with C++ keyword on rs/6000
  3349. - */
  3350. -fix = {
  3351. - hackname = rs6000_double;
  3352. - files = math.h;
  3353. - select = '[^a-zA-Z_]class\(';
  3354. -
  3355. - c_fix = format;
  3356. - c_fix_arg = "#ifndef __cplusplus\n%0\n#endif";
  3357. - c_fix_arg = '^.*[^a-zA-Z_]class\(.*';
  3358. -
  3359. - test_text = "extern int class();";
  3360. -};
  3361. -
  3362. -/*
  3363. - * Wrong fchmod prototype on RS/6000.
  3364. - */
  3365. -fix = {
  3366. - hackname = rs6000_fchmod;
  3367. - files = sys/stat.h;
  3368. - select = 'fchmod\(char \*';
  3369. - c_fix = format;
  3370. - c_fix_arg = "fchmod(int";
  3371. - test_text = "extern int fchmod(char *, mode_t);";
  3372. -};
  3373. -
  3374. -/*
  3375. - * parameters conflict with C++ new on rs/6000
  3376. - */
  3377. -fix = {
  3378. - hackname = rs6000_param;
  3379. - files = "stdio.h";
  3380. - files = "unistd.h";
  3381. -
  3382. - select = 'rename\(const char \*old, const char \*new\)';
  3383. - c_fix = format;
  3384. - c_fix_arg = 'rename(const char *_old, const char *_new)';
  3385. -
  3386. - test_text = 'extern int rename(const char *old, const char *new);';
  3387. -};
  3388. -
  3389. -/*
  3390. - * Solaris 10+ <sys/feature_tests.h> defines _RESTRICT_KYWD as restrict
  3391. - * for C99. This is wrong for C++, which needs many C99 features, but
  3392. - * only supports __restrict.
  3393. - */
  3394. -fix = {
  3395. - hackname = solaris___restrict;
  3396. - files = sys/feature_tests.h;
  3397. - select = "#define[ \t]*_RESTRICT_KYWD[ \t]*restrict";
  3398. - mach = "*-*-solaris2*";
  3399. - c_fix = format;
  3400. - c_fix_arg = "#ifdef __cplusplus\n#define\t_RESTRICT_KYWD\t__restrict\n"
  3401. - "#else\n%0\n#endif";
  3402. - test_text = "#define _RESTRICT_KYWD restrict";
  3403. -};
  3404. -
  3405. -/*
  3406. - * Solaris 10+ complex.h defines _Complex_I and _Imaginary_I in terms of
  3407. - * themselves, which are Sun Studio compiler intrinsics. Remove _Imaginary_I
  3408. - * and imaginary definitions which are not supported by GCC.
  3409. - */
  3410. -fix = {
  3411. - hackname = solaris_complex;
  3412. - mach = "*-*-solaris2.*";
  3413. - files = complex.h;
  3414. - select = "#define[ \t]_Complex_I[ \t]_Complex_I";
  3415. - sed = "s/#define[ \t]_Complex_I[ \t]_Complex_I/"
  3416. - "#define\t_Complex_I\t(__extension__ 1.0iF)/";
  3417. - sed = "/#define[ \t]_Imaginary_I[ \t]_Imaginary_I/d";
  3418. - sed = "/#define[ \t]imaginary[ \t]_Imaginary/d";
  3419. - sed = "s/#define[ \t]I[ \t]\\{1,\\}_Imaginary_I/#define\tI\t\t_Complex_I/";
  3420. - test_text = "#define _Complex_I _Complex_I\n"
  3421. - "#define complex _Complex\n"
  3422. - "#define _Imaginary_I _Imaginary_I\n"
  3423. - "#define imaginary _Imaginary\n"
  3424. - "#undef I\n"
  3425. - "#define I _Imaginary_I";
  3426. -};
  3427. -
  3428. -/*
  3429. - * Solaris 10+ <complex.h> is wrapped in #ifndef __cplusplus. Wrap in
  3430. - * extern "C" instead so libstdc++ can use it.
  3431. - */
  3432. -fix = {
  3433. - hackname = solaris_complex_cxx;
  3434. - mach = "*-*-solaris2.*";
  3435. - files = complex.h;
  3436. - sed = "/#if[ \t]*!defined(__cplusplus)/c\\\n"
  3437. - "#ifdef\t__cplusplus\\\nextern \"C\" {\\\n#endif";
  3438. - sed = "/#endif[ \t]*\\/\\* !defined(__cplusplus) \\*\\//c\\\n"
  3439. - "#ifdef\t__cplusplus\\\n}\\\n#endif";
  3440. - test_text = "#if !defined(__cplusplus)\n"
  3441. - "#endif /* !defined(__cplusplus) */";
  3442. -};
  3443. -
  3444. -/*
  3445. - * g++ rejects functions declared with both C and C++ linkage.
  3446. - */
  3447. -fix = {
  3448. - hackname = solaris_cxx_linkage;
  3449. - mach = '*-*-solaris2*';
  3450. - files = "iso/stdlib_iso.h";
  3451. - select = "(#if __cplusplus >= 199711L)\n"
  3452. - "(extern \"C\\+\\+\" \\{\n)"
  3453. - "(.*(bsearch|qsort).*)";
  3454. - c_fix = format;
  3455. - c_fix_arg = "%1 && !__GNUG__\n%2%3";
  3456. -
  3457. - test_text =
  3458. - "#if __cplusplus >= 199711L\n"
  3459. - "extern \"C++\" {\n"
  3460. - " void *bsearch(const void *, const void *, size_t, size_t,";
  3461. -};
  3462. -
  3463. -/*
  3464. - * Solaris <iso/stdio_iso.h> doesn't declare getc for C++ with
  3465. - * _STRICT_STDC, but uses it.
  3466. - */
  3467. -fix = {
  3468. - hackname = solaris_getc_strict_stdc;
  3469. - mach = "*-*-solaris2*";
  3470. - files = "iso/stdio_iso.h";
  3471. - select = "(.*&& )!defined\\(_STRICT_STDC\\)(.*)";
  3472. - c_fix = format;
  3473. - c_fix_arg = "%1(!defined(_STRICT_STDC) || (__cplusplus >= 199711L))%2";
  3474. -
  3475. - test_text =
  3476. - "#if !defined(_REENTRANT) && !defined(_LP64) && !defined(_STRICT_STDC)";
  3477. -};
  3478. -
  3479. -/*
  3480. - * Solaris <iso/stdio_iso.h> should deprecate gets before C11.
  3481. - */
  3482. -fix = {
  3483. - hackname = solaris_gets_c11;
  3484. - mach = "*-*-solaris2*";
  3485. - files = "iso/stdio_iso.h";
  3486. - select = "(extern char[ \t]*\\*gets\\(char \\*\\));";
  3487. -
  3488. - c_fix = format;
  3489. - c_fix_arg = "#if __STDC_VERSION__ < 201112L && __cplusplus < 201402L\n"
  3490. - "%1 __attribute__((__deprecated__));\n"
  3491. - "#endif";
  3492. -
  3493. - test_text = "extern char *gets(char *);";
  3494. -};
  3495. -
  3496. -/*
  3497. - * Solaris <iso/stdio_iso.h> shouldn't declare gets for C++14.
  3498. - */
  3499. -fix = {
  3500. - hackname = solaris_gets_cxx14;
  3501. - mach = "*-*-solaris2*";
  3502. - files = "iso/stdio_iso.h";
  3503. - select = <<- _EOSelect_
  3504. -(#if __STDC_VERSION__ < 201112L)
  3505. -(extern char \*gets\(char \*\) __ATTR_DEPRECATED;)
  3506. -_EOSelect_;
  3507. - c_fix = format;
  3508. - c_fix_arg = "%1 && __cplusplus < 201402L\n%2";
  3509. -
  3510. - test_text = <<- _EOText_
  3511. -#if __STDC_VERSION__ < 201112L
  3512. -extern char *gets(char *) __ATTR_DEPRECATED;
  3513. -_EOText_;
  3514. -};
  3515. -
  3516. -/*
  3517. - * Sun Solaris 2 has a version of sys/int_const.h that defines
  3518. - * UINT8_C and UINT16_C to unsigned constants.
  3519. - */
  3520. -fix = {
  3521. - hackname = solaris_int_const;
  3522. - files = sys/int_const.h;
  3523. - mach = '*-*-solaris2*';
  3524. - c_fix = format;
  3525. - c_fix_arg = "#define\tUINT8_C(c)\t(c)\n"
  3526. - "%1\n"
  3527. - "#define\tUINT16_C(c)\t(c)";
  3528. - select = "^#define[ \t]+UINT8_C\\(c\\)[ \t]+__CONCAT__.*\n"
  3529. - "(/\*.*\*/)\n"
  3530. - "#define[ \t]+UINT16_C\\(c\\)[ \t]+__CONCAT__.*";
  3531. - test_text =
  3532. - "#define UINT8_C(c) __CONCAT__(c,u)\n"
  3533. - "/* CSTYLED */\n"
  3534. - "#define UINT16_C(c) __CONCAT__(c,u)";
  3535. -};
  3536. -
  3537. -/*
  3538. - * Sun Solaris 2 has a version of sys/int_limits.h that defines
  3539. - * UINT8_MAX and UINT16_MAX to unsigned constants.
  3540. - */
  3541. -fix = {
  3542. - hackname = solaris_int_limits_1;
  3543. - files = sys/int_limits.h;
  3544. - mach = '*-*-solaris2*';
  3545. - c_fix = format;
  3546. - c_fix_arg = "#define\tUINT8_MAX\t(255)\n"
  3547. - "#define\tUINT16_MAX\t(65535)";
  3548. - select = "^#define[ \t]+UINT8_MAX[ \t]+\\(255U\\)\n"
  3549. - "#define[ \t]+UINT16_MAX[ \t]+\\(65535U\\)";
  3550. - test_text =
  3551. - "#define UINT8_MAX (255U)\n"
  3552. - "#define UINT16_MAX (65535U)";
  3553. -};
  3554. -
  3555. -/*
  3556. - * Sun Solaris 2 has a version of sys/int_limits.h that defines
  3557. - * INT_FAST16 limits to wrong values for sys/int_types.h.
  3558. - */
  3559. -fix = {
  3560. - hackname = solaris_int_limits_2;
  3561. - files = sys/int_limits.h;
  3562. - mach = '*-*-solaris2*';
  3563. - c_fix = format;
  3564. - c_fix_arg = "#define\t%1_FAST16_%2 %132_%2";
  3565. - select = "^#define[ \t]+(INT|UINT)_FAST16_(MAX|MIN)[ \t](INT|UINT)16.*";
  3566. - test_text =
  3567. - "#define INT_FAST16_MAX INT16_MAX\n"
  3568. - "#define UINT_FAST16_MAX UINT16_MAX\n"
  3569. - "#define INT_FAST16_MIN INT16_MIN";
  3570. -};
  3571. -
  3572. -/*
  3573. - * Sun Solaris 2 has a version of sys/int_limits.h that defines
  3574. - * SIZE_MAX as unsigned long.
  3575. - */
  3576. -fix = {
  3577. - hackname = solaris_int_limits_3;
  3578. - files = sys/int_limits.h;
  3579. - mach = '*-*-solaris2*';
  3580. - c_fix = format;
  3581. - c_fix_arg = "#define\tSIZE_MAX\t4294967295U";
  3582. - select = "^#define[ \t]+SIZE_MAX[ \t]+4294967295UL";
  3583. - test_text =
  3584. - "#define SIZE_MAX 4294967295UL";
  3585. -};
  3586. -
  3587. -/*
  3588. - * Sun Solaris 10 defines several C99 math macros in terms of
  3589. - * builtins specific to the Studio compiler, in particular not
  3590. - * compatible with the GNU compiler.
  3591. - */
  3592. -fix = {
  3593. - hackname = solaris_math_1;
  3594. - select = '@\(#\)math_c99.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
  3595. - bypass = "__GNUC__";
  3596. - files = iso/math_c99.h;
  3597. - c_fix = format;
  3598. - c_fix_arg = "#define\tHUGE_VA%1\t(__builtin_huge_va%2())";
  3599. - c_fix_arg = "^#define[ \t]+HUGE_VA([LF]+)[ \t]+__builtin_huge_va([lf]+)";
  3600. - test_text =
  3601. - '#ident "@(#)math_c99.h 1.9 04/11/01 SMI"'"\n"
  3602. - "#undef HUGE_VAL\n"
  3603. - "#define HUGE_VAL __builtin_huge_val\n"
  3604. - "#undef HUGE_VALF\n"
  3605. - "#define HUGE_VALF __builtin_huge_valf\n"
  3606. - "#undef HUGE_VALL\n"
  3607. - "#define HUGE_VALL __builtin_huge_vall";
  3608. -};
  3609. -
  3610. -/*
  3611. - * On Solaris 11, if you do isinf(NaN) you'll get a floating point
  3612. - * exception. Provide an alternative using GCC's builtin.
  3613. - */
  3614. -fix = {
  3615. - hackname = solaris_math_10;
  3616. - select = '@\(#\)math_c99.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
  3617. - files = iso/math_c99.h;
  3618. - c_fix = format;
  3619. - c_fix_arg = "#define\tisinf(x) __builtin_isinf(x)";
  3620. - c_fix_arg = "^#define[ \t]+isinf\\(x\\)[ \t]+__extension__\\([ \t]*\\\\\n"
  3621. - "[ \t]*\\{[ \t]*__typeof\\(x\\)[ \t]*__x_i[ \t]*=[ \t]*\\(x\\);"
  3622. - "[ \t]*\\\\\n"
  3623. - "[ \t]*__x_i[ \t]*==[ \t]*\\(__typeof\\(__x_i\\)\\)[ \t]*"
  3624. - "INFINITY[ \t]*\\|\\|[ \t]*\\\\\n"
  3625. - "[ \t]*__x_i[ \t]*==[ \t]*\\(__typeof\\(__x_i\\)\\)[ \t]*"
  3626. - "\\(-INFINITY\\);[ \t]*\\}\\)";
  3627. - test_text =
  3628. - '#pragma ident "@(#)math_c99.h 1.12 07/01/21 SMI"'"\n"
  3629. - "#undef isinf\n"
  3630. - "#define isinf(x) __extension__( \\\\\n"
  3631. - " { __typeof(x) __x_i = (x); \\\\\n"
  3632. - " __x_i == (__typeof(__x_i)) INFINITY || \\\\\n"
  3633. - " __x_i == (__typeof(__x_i)) (-INFINITY); })";
  3634. -};
  3635. -
  3636. -/*
  3637. - * Solaris math INFINITY
  3638. - */
  3639. -fix = {
  3640. - hackname = solaris_math_2;
  3641. - select = '@\(#\)math_c99.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
  3642. - bypass = "__GNUC__";
  3643. - files = iso/math_c99.h;
  3644. - c_fix = format;
  3645. - c_fix_arg = "#define\tINFINITY\t(__builtin_inff())";
  3646. - c_fix_arg = "^#define[ \t]+INFINITY[ \t]+__builtin_infinity";
  3647. - test_text =
  3648. - '#ident "@(#)math_c99.h 1.9 04/11/01 SMI"'"\n"
  3649. - "#undef INFINITY\n"
  3650. - "#define INFINITY __builtin_infinity";
  3651. -};
  3652. -
  3653. -/*
  3654. - * Solaris math NAN
  3655. - */
  3656. -fix = {
  3657. - hackname = solaris_math_3;
  3658. - select = '@\(#\)math_c99.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
  3659. - bypass = "__GNUC__";
  3660. - files = iso/math_c99.h;
  3661. - c_fix = format;
  3662. - c_fix_arg = "#define\tNAN\t\t(__builtin_nanf(\"\"))";
  3663. - c_fix_arg = "^#define[ \t]+NAN[ \t]+__builtin_nan";
  3664. - test_text =
  3665. - '#ident "@(#)math_c99.h 1.9 04/11/01 SMI"'"\n"
  3666. - "#undef NAN\n"
  3667. - "#define NAN __builtin_nan";
  3668. -};
  3669. -
  3670. -/*
  3671. - * Solaris math fpclassify
  3672. - */
  3673. -fix = {
  3674. - hackname = solaris_math_4;
  3675. - select = '@\(#\)math_c99.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
  3676. - bypass = "__GNUC__";
  3677. - files = iso/math_c99.h;
  3678. - c_fix = format;
  3679. - c_fix_arg = "#define\tfpclassify(x) \\\n"
  3680. - " __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, "
  3681. - "FP_SUBNORMAL, FP_ZERO, (x))";
  3682. - c_fix_arg = "^#define[ \t]+fpclassify\\(x\\)[ \t]+__builtin_fpclassify\\(x\\)";
  3683. - test_text =
  3684. - '#ident "@(#)math_c99.h 1.9 04/11/01 SMI"'"\n"
  3685. - "#undef fpclassify\n"
  3686. - "#define fpclassify(x) __builtin_fpclassify(x)";
  3687. -};
  3688. -
  3689. -/*
  3690. - * Solaris math signbit
  3691. - */
  3692. -fix = {
  3693. - hackname = solaris_math_8;
  3694. - select = '@\(#\)math_c99\.h' "[ \t]+1\\.[0-9]+[ \t]+[0-9/]+ SMI";
  3695. - bypass = "__GNUC__";
  3696. - files = iso/math_c99.h;
  3697. - c_fix = format;
  3698. - c_fix_arg = "#define\tsignbit(x)\t(sizeof(x) == sizeof(float) \\\n"
  3699. - "\t\t\t ? __builtin_signbitf(x) \\\n"
  3700. - "\t\t\t : sizeof(x) == sizeof(long double) \\\n"
  3701. - "\t\t\t ? __builtin_signbitl(x) \\\n"
  3702. - "\t\t\t : __builtin_signbit(x))";
  3703. - c_fix_arg = "^#define[ \t]+signbit\\(x\\)[ \t]+__builtin_signbit\\(x\\)";
  3704. - test_text = <<- _EOText_
  3705. - #ident "@(#)math_c99.h 1.9 04/11/01 SMI"
  3706. - #undef signbit
  3707. - #define signbit(x) __builtin_signbit(x)
  3708. - _EOText_;
  3709. -};
  3710. -
  3711. -/*
  3712. - * Solaris math comparison macros
  3713. - */
  3714. -fix = {
  3715. - hackname = solaris_math_9;
  3716. - select = '@\(#\)math_c99.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
  3717. - bypass = "__GNUC__";
  3718. - files = iso/math_c99.h;
  3719. - c_fix = format;
  3720. - c_fix_arg = "#define\t%1(x, y)%2__builtin_%1(x, y)";
  3721. - c_fix_arg = "^#define[ \t]+([a-z]+)\\(x, y\\)([ \t]+)\\(\\(x\\) "
  3722. - "__builtin_[a-z]+\\(y\\)\\)";
  3723. - test_text =
  3724. - '#ident "@(#)math_c99.h 1.9 04/11/01 SMI"'"\n"
  3725. - "#undef isgreater\n"
  3726. - "#define isgreater(x, y) ((x) __builtin_isgreater(y))\n"
  3727. - "#undef isgreaterequal\n"
  3728. - "#define isgreaterequal(x, y) ((x) __builtin_isgreaterequal(y))\n"
  3729. - "#undef isless\n"
  3730. - "#define isless(x, y) ((x) __builtin_isless(y))\n"
  3731. - "#undef islessequal\n"
  3732. - "#define islessequal(x, y) ((x) __builtin_islessequal(y))\n"
  3733. - "#undef islessgreater\n"
  3734. - "#define islessgreater(x, y) ((x) __builtin_islessgreater(y))\n"
  3735. - "#undef isunordered\n"
  3736. - "#define isunordered(x, y) ((x) __builtin_isunordered(y))";
  3737. -};
  3738. -
  3739. -/*
  3740. - * Newer Solaris 10/11 GCC signbit implementations cause strict-aliasing
  3741. - * warnings.
  3742. - */
  3743. -fix = {
  3744. - hackname = solaris_math_11;
  3745. - select = '@\(#\)math_c99\.h' "[ \t]+1\\.[0-9]+[ \t]+[0-9/]+ ";
  3746. - files = iso/math_c99.h;
  3747. - c_fix = format;
  3748. - c_fix_arg = << _EOArg_
  3749. -#undef signbit
  3750. -#define signbit(x) (sizeof(x) == sizeof(float) \
  3751. - ? __builtin_signbitf(x) \
  3752. - : sizeof(x) == sizeof(long double) \
  3753. - ? __builtin_signbitl(x) \
  3754. - : __builtin_signbit(x))
  3755. -_EOArg_;
  3756. - c_fix_arg = << _EOArg_
  3757. -^#undef[ ]+signbit
  3758. -#if defined\(__sparc\)
  3759. -#define[ ]+signbit\(x\)[ ]+__extension__\( \\
  3760. -[ ]+\{[ ]*__typeof\(x\)[ ]*__x_s[ ]*=[ ]*\(x\);[ ]*\\
  3761. -[ ]+\(int\)[ ]*\(\*\(unsigned[ ]*\*\)[ ]*\&__x_s[ ]*>>[ ]*31\);[ ]*\}\)
  3762. -#elif defined\(__i386\) \|\| defined\(__amd64\)
  3763. -#define[ ]+signbit\(x\)[ ]+__extension__\( \\
  3764. -[ ]+\{ __typeof\(x\) __x_s = \(x\); \\
  3765. -[ ]+\(sizeof \(__x_s\) == sizeof \(float\) \? \\
  3766. -[ ]+\(int\) \(\*\(unsigned \*\) \&__x_s >> 31\) : \\
  3767. -[ ]+sizeof \(__x_s\) == sizeof \(double\) \? \\
  3768. -[ ]+\(int\) \(\(\(unsigned \*\) \&__x_s\)\[1\] >> 31\) : \\
  3769. -[ ]+\(int\) \(\(\(unsigned short \*\) \&__x_s\)\[4\] >> 15\)\); \}\)
  3770. -#endif
  3771. -_EOArg_;
  3772. - test_text = << _EOText_
  3773. -/* @(#)math_c99.h 1.14 13/03/27 */
  3774. -#undef signbit
  3775. -#if defined(__sparc)
  3776. -#define signbit(x) __extension__( \\
  3777. - { __typeof(x) __x_s = (x); \\
  3778. - (int) (*(unsigned *) &__x_s >> 31); })
  3779. -#elif defined(__i386) || defined(__amd64)
  3780. -#define signbit(x) __extension__( \\
  3781. - { __typeof(x) __x_s = (x); \\
  3782. - (sizeof (__x_s) == sizeof (float) ? \\
  3783. - (int) (*(unsigned *) &__x_s >> 31) : \\
  3784. - sizeof (__x_s) == sizeof (double) ? \\
  3785. - (int) (((unsigned *) &__x_s)[1] >> 31) : \\
  3786. - (int) (((unsigned short *) &__x_s)[4] >> 15)); })
  3787. -#endif
  3788. -_EOText_;
  3789. -};
  3790. -
  3791. -/*
  3792. - * Some versions of Solaris 10+ <math.h> #undef libstdc++-internal macros.
  3793. - */
  3794. -fix = {
  3795. - hackname = solaris_math_12;
  3796. - files = math.h;
  3797. - mach = '*-*-solaris2*';
  3798. - select = '#undef.*_GLIBCXX_USE_C99_MATH';
  3799. - sed = "/#undef[ \t]*_GLIBCXX_USE_C99_MATH/d";
  3800. - test_text = << _EOText_
  3801. -#if __cplusplus >= 201103L
  3802. -#undef _GLIBCXX_USE_C99_MATH
  3803. -#undef _GLIBCXX_USE_C99_MATH_TR1
  3804. -#endif
  3805. -_EOText_;
  3806. -};
  3807. -
  3808. -/*
  3809. - * Sun Solaris defines PTHREAD_ONCE_INIT as an array containing a
  3810. - * structure. As such, it need two levels of brackets, but only
  3811. - * contains one. Wrap the macro definition in an extra layer.
  3812. - */
  3813. -fix = {
  3814. - hackname = solaris_once_init_1;
  3815. - select = '@\(#\)pthread.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
  3816. - files = pthread.h;
  3817. - mach = '*-*-solaris*';
  3818. - c_fix = format;
  3819. - c_fix_arg = "%1{%2}%3";
  3820. - c_fix_arg = "(^#define[ \t]+PTHREAD_ONCE_INIT[ \t]+\\{)([^}]+)(\\})[ \t]*$";
  3821. - test_text =
  3822. - '#pragma ident "@(#)pthread.h 1.37 04/09/28 SMI"'"\n"
  3823. - "#define PTHREAD_ONCE_INIT\t{0, 0, 0, PTHREAD_ONCE_NOTDONE}";
  3824. -};
  3825. -
  3826. -/*
  3827. - * Solaris 10+ <spawn.h> uses char *const argv[_RESTRICT_KYWD] in the
  3828. - * posix_spawn declarations, which doesn't work with C++.
  3829. - */
  3830. -fix = {
  3831. - hackname = solaris_posix_spawn_restrict;
  3832. - files = spawn.h;
  3833. - mach = '*-*-solaris2*';
  3834. - c_fix = format;
  3835. - c_fix_arg = "%1*_RESTRICT_KYWD %2%3";
  3836. - select = "(.*[ \t]+)([a-z]+)\\[_RESTRICT_KYWD\\](.*)";
  3837. - test_text =
  3838. - "char *const argv[_RESTRICT_KYWD],\n"
  3839. - "char *const envp[_RESTRICT_KYWD]);";
  3840. -};
  3841. -
  3842. -/*
  3843. - * The pow overloads with int were removed in C++ 2011 DR 550.
  3844. - */
  3845. -fix = {
  3846. - hackname = solaris_pow_int_overload;
  3847. - mach = '*-*-solaris2*';
  3848. - files = "iso/math_iso.h";
  3849. - select = "^[ \t]*inline [a-z ]* pow\\([^()]*, int [^()]*\\)"
  3850. - " *\\{[^{}]*\n[^{}]*\\}";
  3851. - c_fix = format;
  3852. - c_fix_arg = "#if __cplusplus < 201103L\n%0\n#endif";
  3853. -
  3854. - test_text =
  3855. - " inline long double pow(long double __X, int __Y) { return\n"
  3856. - " __powl(__X, (long double) (__Y)); }";
  3857. -};
  3858. -
  3859. -/*
  3860. - * Sun Solaris defines PTHREAD_RWLOCK_INITIALIZER with a "0" for some
  3861. - * fields of the pthread_rwlock_t structure, which are of type
  3862. - * upad64_t, which itself is typedef'd to int64_t, but with __STDC__
  3863. - * defined (e.g. by -ansi) it is a union. So change the initializer
  3864. - * to "{0}" instead.
  3865. - */
  3866. -fix = {
  3867. - hackname = solaris_rwlock_init_1;
  3868. - select = '@\(#\)pthread.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
  3869. - files = pthread.h;
  3870. - mach = '*-*-solaris*';
  3871. - c_fix = format;
  3872. - c_fix_arg = "#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)\n"
  3873. - "%0\n"
  3874. - "#else\n"
  3875. - "%1{0, 0, 0, {{0}, {0}, {0}}, {{0}, {0}}, {{0}, {0}}}\n"
  3876. - "#endif";
  3877. - c_fix_arg = "(^#define[ \t]+PTHREAD_RWLOCK_INITIALIZER[ \t]+)"
  3878. - "\\{0, 0, 0, \\{0, 0, 0\\}, \\{0, 0\\}, \\{0, 0\\}\\}[ \t]*$";
  3879. -
  3880. - test_text =
  3881. - '#ident "@(#)pthread.h 1.26 98/04/12 SMI"'"\n"
  3882. - "#define PTHREAD_RWLOCK_INITIALIZER\t{0, 0, 0, {0, 0, 0}, {0, 0}, {0, 0}}";
  3883. -};
  3884. -
  3885. -/*
  3886. - * Before Solaris 10, <stdio.h> lacks declarations of std::__filbuf and
  3887. - * std::__flsbuf, but <iso/stdio_iso.h> uses them.
  3888. - */
  3889. -fix = {
  3890. - hackname = solaris_std___filbuf;
  3891. - files = stdio.h;
  3892. - mach = '*-*-solaris2*';
  3893. - bypass = "using std::__filbuf";
  3894. - select = "(using std::perror;\n)(#endif)";
  3895. - c_fix = format;
  3896. - c_fix_arg = "%1#ifndef _LP64\n"
  3897. - "using std::__filbuf;\n"
  3898. - "using std::__flsbuf;\n"
  3899. - "#endif\n%2";
  3900. -
  3901. - test_text = "using std::perror;\n"
  3902. - "#endif";
  3903. -};
  3904. -
  3905. -/*
  3906. - * Solaris <stdio.h> shouldn't use std::gets for C++14.
  3907. - */
  3908. -fix = {
  3909. - hackname = solaris_std_gets_cxx14;
  3910. - mach = "*-*-solaris2*";
  3911. - files = "stdio.h";
  3912. - select = "using std::gets;";
  3913. -
  3914. - c_fix = format;
  3915. - c_fix_arg = "#if __cplusplus < 201402L\n%0\n#endif";
  3916. -
  3917. - test_text = "using std::gets;";
  3918. -};
  3919. -
  3920. -/*
  3921. - * Sun Solaris 8 has what appears to be some gross workaround for
  3922. - * some old version of their c++ compiler. G++ doesn't want it
  3923. - * either, but doesn't want to be tied to SunPRO version numbers.
  3924. - */
  3925. -fix = {
  3926. - hackname = solaris_stdio_tag;
  3927. - files = stdio_tag.h;
  3928. -
  3929. - select = '__cplusplus < 54321L';
  3930. - /* In Solaris 10, the code in stdio_tag.h is conditionalized on
  3931. - "!defined(__GNUC__)" so we no longer need to fix it. */
  3932. - bypass = '__GNUC__';
  3933. - sed = 's/defined(__cplusplus) && (__cplusplus < 54321L)/0/';
  3934. -
  3935. - test_text = "#if\tdefined(__cplusplus) && (__cplusplus < 54321L)";
  3936. -};
  3937. -
  3938. -/*
  3939. - * Solaris <stdlib.h> shouldn't use _Noreturn, breaks with C++.
  3940. - */
  3941. -fix = {
  3942. - hackname = solaris_stdlib_noreturn;
  3943. - mach = "*-*-solaris2*";
  3944. - files = "iso/stdlib_c99.h";
  3945. - select = "(extern) _Noreturn (void quick_exit\\(int\\));";
  3946. -
  3947. - c_fix = format;
  3948. - c_fix_arg = "%1 %2 __attribute__((__noreturn__));";
  3949. -
  3950. - test_text = "extern _Noreturn void quick_exit(int);";
  3951. -};
  3952.  
  3953. /*
  3954. * a missing semi-colon at the end of the statsswtch structure definition.
  3955. @@ -5057,7 +1743,7 @@
  3956.  
  3957. c_fix = format;
  3958. c_fix_arg = "%0\n"
  3959. - "#define ioctl(fd, func, arg) ioctl(fd, func, (int)(arg))\n";
  3960. + "#define ioctl(fd, func, arg) (ioctl)(fd, func, (int)(arg))\n";
  3961. c_fix_arg = "extern[\t ]+int[\t ]+ioctl[\t ]*\\([\t ,[:alnum:]]*\\);";
  3962.  
  3963. test_text = "extern int ioctl ( int asdf1234, int jkl , int qwerty ) ;";
  3964. @@ -5172,22 +1858,6 @@
  3965. };
  3966.  
  3967. /*
  3968. - * This hack ensures the include_next in the fixed unistd.h actually
  3969. - * finds the system's unistd.h and not the fixed unistd.h again.
  3970. - */
  3971. -fix = {
  3972. - hackname = vxworks_iolib_include_unistd;
  3973. - files = ioLib.h;
  3974. - mach = "*-*-vxworks*";
  3975. - select = "#include \"unistd.h\"";
  3976. -
  3977. - c_fix = format;
  3978. - c_fix_arg = "#include <unistd.h>";
  3979. -
  3980. - test_text = "#include \"unistd.h\"";
  3981. -};
  3982. -
  3983. -/*
  3984. * There are several name conflicts with C++ reserved words in X11 header
  3985. * files. These are fixed in some versions, so don't do the fixes if
  3986. * we find __cplusplus in the file. These were found on the RS/6000.
  3987. diff -Naur gcc-9.5.0/gcc/config/mips/iris6.h gcc-9.5.0-irix/gcc/config/mips/iris6.h
  3988. --- gcc-9.5.0/gcc/config/mips/iris6.h 1969-12-31 19:00:00.000000000 +0000
  3989. +++ gcc-9.5.0-irix/gcc/config/mips/iris6.h 2025-02-13 08:55:07.388956000 +0000
  3990. @@ -0,0 +1,387 @@
  3991. +/* Definitions of target machine for GNU compiler. IRIX 6.5 version.
  3992. + Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 2000,
  3993. + 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
  3994. + Free Software Foundation, Inc.
  3995. +
  3996. +This file is part of GCC.
  3997. +
  3998. +GCC is free software; you can redistribute it and/or modify
  3999. +it under the terms of the GNU General Public License as published by
  4000. +the Free Software Foundation; either version 3, or (at your option)
  4001. +any later version.
  4002. +
  4003. +GCC is distributed in the hope that it will be useful,
  4004. +but WITHOUT ANY WARRANTY; without even the implied warranty of
  4005. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  4006. +GNU General Public License for more details.
  4007. +
  4008. +You should have received a copy of the GNU General Public License
  4009. +along with GCC; see the file COPYING3. If not see
  4010. +<http://www.gnu.org/licenses/>. */
  4011. +
  4012. +/* We are compiling for IRIX 6 now. */
  4013. +#undef TARGET_IRIX6
  4014. +#define TARGET_IRIX6 1
  4015. +
  4016. +/* we use GNU binutils here */
  4017. +#define IRIX_USING_GNU_LD 1
  4018. +
  4019. +/* Default to -mabi=n32 and -mips3. */
  4020. +#undef MULTILIB_DEFAULTS
  4021. +#define MULTILIB_DEFAULTS { "mabi=n32" }
  4022. +
  4023. +/* -march=native handling only makes sense with compiler running on
  4024. + a MIPS chip. */
  4025. +#if defined(__mips__)
  4026. +extern const char *host_detect_local_cpu (int argc, const char **argv);
  4027. +# define EXTRA_SPEC_FUNCTIONS \
  4028. + { "local_cpu_detect", host_detect_local_cpu },
  4029. +
  4030. +# define MARCH_MTUNE_NATIVE_SPECS \
  4031. + " %{march=native:%<march=native %:local_cpu_detect(arch)}" \
  4032. + " %{mtune=native:%<mtune=native %:local_cpu_detect(tune)}"
  4033. +#else
  4034. +# define MARCH_MTUNE_NATIVE_SPECS ""
  4035. +#endif
  4036. +
  4037. +#define PREFERRRED_DEBUGGING_TYPE DWARF2_DEBUG
  4038. +
  4039. +/* Force the default ABI onto the command line in order to make the specs
  4040. + easier to write. */
  4041. +#undef DRIVER_SELF_SPECS
  4042. +#define DRIVER_SELF_SPECS \
  4043. + "%{!mabi=*: -mabi=n32}", \
  4044. + /* Configuration-independent MIPS rules. */ \
  4045. + BASE_DRIVER_SELF_SPECS, \
  4046. + MARCH_MTUNE_NATIVE_SPECS
  4047. +
  4048. +/* IRIX 6.5 has the float and long double forms of math functions. */
  4049. +#undef TARGET_LIBC_HAS_FUNCTION
  4050. +#define TARGET_LIBC_HAS_FUNCTION default_libc_has_function
  4051. +/* MIPS specific debugging info */
  4052. +/* #define MIPS_DEBUGGING_INFO 1 */
  4053. +#define SGUG_DEBUGGING_INFO 1
  4054. +
  4055. +/* Force the generation of dwarf .debug_frame sections even if not
  4056. + compiling -g. This guarantees that we can unwind the stack. */
  4057. +#define DWARF2_FRAME_INFO 1
  4058. +
  4059. +/* The system unwinder in libexc requires a specific dwarf return address
  4060. + column to work. */
  4061. +#undef DWARF_FRAME_RETURN_COLUMN
  4062. +#define DWARF_FRAME_RETURN_COLUMN (FP_REG_LAST + 1)
  4063. +
  4064. +/* The size in bytes of a DWARF field indicating an offset or length
  4065. + relative to a debug info section, specified to be 4 bytes in the DWARF-2
  4066. + specification. The SGI/MIPS ABI defines it to be the same as PTR_SIZE. */
  4067. +#define DWARF_OFFSET_SIZE PTR_SIZE
  4068. +
  4069. +/* The size in bytes of the initial length field in a debug info
  4070. + section. The DWARF 3 (draft) specification defines this to be
  4071. + either 4 or 12 (with a 4-byte "escape" word when it's 12), but the
  4072. + SGI/MIPS ABI predates this standard and defines it to be the same
  4073. + as DWARF_OFFSET_SIZE. */
  4074. +#define DWARF_INITIAL_LENGTH_SIZE DWARF_OFFSET_SIZE
  4075. +
  4076. +/* MIPS assemblers don't have the usual .set foo,bar construct;
  4077. + .set is used for assembler options instead. */
  4078. +#undef SET_ASM_OP
  4079. +#define ASM_OUTPUT_DEF(FILE, LABEL1, LABEL2) \
  4080. + do \
  4081. + { \
  4082. + fputc ('\t', FILE); \
  4083. + assemble_name (FILE, LABEL1); \
  4084. + fputs (" = ", FILE); \
  4085. + assemble_name (FILE, LABEL2); \
  4086. + fputc ('\n', FILE); \
  4087. + } \
  4088. + while (0)
  4089. +
  4090. +#undef LOCAL_LABEL_PREFIX
  4091. +#define LOCAL_LABEL_PREFIX "."
  4092. +
  4093. +#undef ASM_DECLARE_OBJECT_NAME
  4094. +#define ASM_DECLARE_OBJECT_NAME mips_declare_object_name
  4095. +
  4096. +#undef ASM_FINISH_DECLARE_OBJECT
  4097. +#define ASM_FINISH_DECLARE_OBJECT mips_finish_declare_object
  4098. +
  4099. +/* The native IRIX 6 linker does not support merging without a special
  4100. + elspec(5) file. */
  4101. +#ifndef IRIX_USING_GNU_LD
  4102. +#undef HAVE_GAS_SHF_MERGE
  4103. +#define HAVE_GAS_SHF_MERGE 0
  4104. +#endif
  4105. +
  4106. +/* Specify wchar_t types. */
  4107. +#undef WCHAR_TYPE
  4108. +#define WCHAR_TYPE (Pmode == DImode ? "int" : "long int")
  4109. +
  4110. +#undef WCHAR_TYPE_SIZE
  4111. +#define WCHAR_TYPE_SIZE INT_TYPE_SIZE
  4112. +
  4113. +/* Same for wint_t. */
  4114. +#undef WINT_TYPE
  4115. +#define WINT_TYPE (Pmode == DImode ? "int" : "long int")
  4116. +
  4117. +#undef WINT_TYPE_SIZE
  4118. +#define WINT_TYPE_SIZE INT_TYPE_SIZE
  4119. +
  4120. +#ifndef USED_FOR_TARGET
  4121. +/* Use long for intmax_t, uintmax_t? */
  4122. +extern int long_intmax;
  4123. +#endif
  4124. +
  4125. +/* C99 stdint.h types. */
  4126. +#define INT8_TYPE "signed char"
  4127. +#define INT16_TYPE "short int"
  4128. +#define INT32_TYPE "int"
  4129. +#define INT64_TYPE "long long int"
  4130. +#define UINT8_TYPE "unsigned char"
  4131. +#define UINT16_TYPE "short unsigned int"
  4132. +#define UINT32_TYPE "unsigned int"
  4133. +#define UINT64_TYPE "long long unsigned int"
  4134. +
  4135. +#define INT_LEAST8_TYPE "signed char"
  4136. +#define INT_LEAST16_TYPE "short int"
  4137. +#define INT_LEAST32_TYPE "int"
  4138. +#define INT_LEAST64_TYPE "long long int"
  4139. +#define UINT_LEAST8_TYPE "unsigned char"
  4140. +#define UINT_LEAST16_TYPE "short unsigned int"
  4141. +#define UINT_LEAST32_TYPE "unsigned int"
  4142. +#define UINT_LEAST64_TYPE "long long unsigned int"
  4143. +
  4144. +#define INT_FAST8_TYPE "signed char"
  4145. +#define INT_FAST16_TYPE "short int"
  4146. +#define INT_FAST32_TYPE "int"
  4147. +#define INT_FAST64_TYPE "long long int"
  4148. +#define UINT_FAST8_TYPE "unsigned char"
  4149. +#define UINT_FAST16_TYPE "short unsigned int"
  4150. +#define UINT_FAST32_TYPE "unsigned int"
  4151. +#define UINT_FAST64_TYPE "long long unsigned int"
  4152. +
  4153. +#define INTMAX_TYPE (long_intmax ? "long int" : "long long int")
  4154. +#define UINTMAX_TYPE (long_intmax ? "long unsigned int" : "long long unsigned int")
  4155. +
  4156. +#define INTPTR_TYPE "long int"
  4157. +#define UINTPTR_TYPE "long unsigned int"
  4158. +
  4159. +#define SIG_ATOMIC_TYPE "int"
  4160. +
  4161. +/* Plain char is unsigned in the SGI compiler. */
  4162. +#undef DEFAULT_SIGNED_CHAR
  4163. +#define DEFAULT_SIGNED_CHAR 0
  4164. +
  4165. +#define TARGET_OS_CPP_BUILTINS() \
  4166. + do \
  4167. + { \
  4168. + builtin_define_std ("host_mips"); \
  4169. + builtin_define_std ("sgi"); \
  4170. + builtin_define_std ("unix"); \
  4171. + builtin_define_std ("SYSTYPE_SVR4"); \
  4172. + builtin_define ("_MODERN_C"); \
  4173. + builtin_define ("_SVR4_SOURCE"); \
  4174. + builtin_define ("__DSO__"); \
  4175. + builtin_assert ("system=unix"); \
  4176. + builtin_assert ("system=svr4"); \
  4177. + builtin_assert ("machine=sgi"); \
  4178. + \
  4179. + if (!ISA_MIPS1 && !ISA_MIPS2) \
  4180. + builtin_define ("_COMPILER_VERSION=601"); \
  4181. + \
  4182. + /* We must always define _LONGLONG, even when -ansi is \
  4183. + used, because IRIX 5 system header files require it. \
  4184. + This is OK, because gcc never warns when long long \
  4185. + is used in system header files. \
  4186. + \
  4187. + An alternative would be to support the SGI builtin \
  4188. + type __long_long. */ \
  4189. + builtin_define ("_LONGLONG"); \
  4190. + \
  4191. + /* IRIX 6.5.18 and above provide many ISO C99 \
  4192. + features protected by the __c99 macro. \
  4193. + libstdc++ v3 needs them as well. */ \
  4194. + if (flag_isoc99 || c_dialect_cxx ()) \
  4195. + builtin_define ("__c99"); \
  4196. + \
  4197. + /* The GNU C++ standard library requires that \
  4198. + __EXTENSIONS__ and _SGI_SOURCE be defined on at \
  4199. + least IRIX 6.2 and probably all IRIX 6 prior to 6.5. \
  4200. + We don't need this on IRIX 6.5 itself, but it \
  4201. + shouldn't hurt other than the namespace pollution. */ \
  4202. + if (!flag_iso || c_dialect_cxx ()) \
  4203. + { \
  4204. + builtin_define ("__EXTENSIONS__"); \
  4205. + builtin_define ("_SGI_SOURCE"); \
  4206. + } \
  4207. + } \
  4208. + while (0)
  4209. +
  4210. +/* SUBTARGET_OVERRIDE_OPTIONS is run after C_COMMON_OVERRIDE_OPTIONS, so
  4211. + only set long_intmax if uninitialized. */
  4212. +#undef SUBTARGET_OVERRIDE_OPTIONS
  4213. +#define SUBTARGET_OVERRIDE_OPTIONS \
  4214. + do \
  4215. + { \
  4216. + if (long_intmax == -1) \
  4217. + long_intmax = mips_abi == ABI_64; \
  4218. + } \
  4219. + while (0)
  4220. +
  4221. +/*
  4222. + if (!global_options_set.x_dwarf_strict) \
  4223. + dwarf_strict = 1; \
  4224. + if (!global_options_set.x_dwarf_version) \
  4225. + dwarf_version = 2; \
  4226. +*/
  4227. +
  4228. +extern void irix6_c_common_override_options (void);
  4229. +#define C_COMMON_OVERRIDE_OPTIONS irix6_c_common_override_options()
  4230. +/*
  4231. +#undef SUBTARGET_CC1_SPEC
  4232. +#define SUBTARGET_CC1_SPEC "%{static: -mno-abicalls}"
  4233. +*/
  4234. +#undef SUBTARGET_CPP_SPEC
  4235. +#define SUBTARGET_CPP_SPEC "%{pthread:-D_REENTRANT}"
  4236. +
  4237. +#undef INIT_SECTION_ASM_OP
  4238. +#define INIT_SECTION_ASM_OP "\t.section\t.gcc_init,\"ax\",@progbits"
  4239. +
  4240. +#undef FINI_SECTION_ASM_OP
  4241. +#define FINI_SECTION_ASM_OP "\t.section\t.gcc_fini,\"ax\",@progbits"
  4242. +
  4243. +#ifdef IRIX_USING_GNU_LD
  4244. +#define IRIX_NO_UNRESOLVED ""
  4245. +#else
  4246. +#define IRIX_NO_UNRESOLVED "-no_unresolved"
  4247. +#endif
  4248. +
  4249. +#ifdef IRIX_USING_GNU_LD
  4250. +#define SUBTARGET_DONT_WARN_UNUSED_SPEC ""
  4251. +#define SUBTARGET_WARN_UNUSED_SPEC ""
  4252. +#else
  4253. +#define SUBTARGET_DONT_WARN_UNUSED_SPEC "-dont_warn_unused"
  4254. +#define SUBTARGET_WARN_UNUSED_SPEC "-warn_unused"
  4255. +#endif
  4256. +
  4257. +/* Profiling is supported via libprof1.a not -lc_p as in IRIX 3. */
  4258. +#undef STARTFILE_SPEC
  4259. +#define STARTFILE_SPEC \
  4260. + "%{!shared: \
  4261. + %{mabi=n32: \
  4262. + %{mips4:%{pg:/usr/lib32/mips4/gcrt1.o%s} \
  4263. + %{!pg:%{p:/usr/lib32/mips4/mcrt1.o%s /usr/lib32/mips4/libprof1.a%s} \
  4264. + %{!p:/usr/lib32/mips4/crt1.o%s}}} \
  4265. + %{!mips4:%{pg:/usr/lib32/mips3/gcrt1.o%s} \
  4266. + %{!pg:%{p:/usr/lib32/mips3/mcrt1.o%s /usr/lib32/mips3/libprof1.a%s} \
  4267. + %{!p:/usr/lib32/mips3/crt1.o%s}}}} \
  4268. + %{mabi=64: \
  4269. + %{mips4:%{pg:/usr/lib64/mips4/gcrt1.o} \
  4270. + %{!pg:%{p:/usr/lib64/mips4/mcrt1.o /usr/lib64/mips4/libprof1.a} \
  4271. + %{!p:/usr/lib64/mips4/crt1.o}}} \
  4272. + %{!mips4:%{pg:/usr/lib64/mips3/gcrt1.o} \
  4273. + %{!pg:%{p:/usr/lib64/mips3/mcrt1.o /usr/lib64/mips3/libprof1.a} \
  4274. + %{!p:/usr/lib64/mips3/crt1.o}}}}} \
  4275. + irix-crti.o%s crtbegin.o%s"
  4276. +
  4277. +#undef LIB_SPEC
  4278. +#define LIB_SPEC \
  4279. + "%{mabi=n32: %{mips4:-L/usr/lib32/mips4} %{!mips4:-L/usr/lib32/mips3} \
  4280. + -L/usr/lib32} \
  4281. + %{mabi=64: %{mips4:-L/usr/lib64/mips4} %{!mips4:-L/usr/lib64/mips3} \
  4282. + -L/usr/lib64} \
  4283. + %{!shared:" \
  4284. + SUBTARGET_DONT_WARN_UNUSED_SPEC \
  4285. + " %{pthread:-lpthread} %{p:libprof1.a%s}%{pg:libprof1.a%s} -lc " \
  4286. + SUBTARGET_WARN_UNUSED_SPEC "}"
  4287. +
  4288. +/* Avoid getting two warnings for libgcc.a everytime we link. libgcc.a
  4289. + contains references to copysignl, so link with libm to resolve them. */
  4290. +#undef LIBGCC_SPEC
  4291. +#define LIBGCC_SPEC \
  4292. + SUBTARGET_DONT_WARN_UNUSED_SPEC " -lgcc -lm " SUBTARGET_WARN_UNUSED_SPEC
  4293. +
  4294. +#undef ENDFILE_SPEC
  4295. +#define ENDFILE_SPEC \
  4296. + "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
  4297. + crtend.o%s irix-crtn.o%s \
  4298. + %{!shared: \
  4299. + %{mabi=n32:%{mips4:/usr/lib32/mips4/crtn.o%s}\
  4300. + %{!mips4:/usr/lib32/mips3/crtn.o%s}}\
  4301. + %{mabi=64:%{mips4:/usr/lib64/mips4/crtn.o%s}\
  4302. + %{!mips4:/usr/lib64/mips3/crtn.o%s}}}"
  4303. +
  4304. +/* Generic part of the LINK_SPEC. */
  4305. +#undef LINK_SPEC
  4306. +#define LINK_SPEC "\
  4307. +%{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} %{mips4} \
  4308. +%{bestGnum} %{shared} %{non_shared} \
  4309. +%{call_shared} %{no_archive} %{exact_version} \
  4310. +%{!shared: \
  4311. + %{!non_shared: %{!call_shared:%{!r: -call_shared " IRIX_NO_UNRESOLVED "}}}} \
  4312. +%{rpath} %{!r: -init __gcc_init -fini __gcc_fini} " IRIX_SUBTARGET_LINK_SPEC
  4313. +
  4314. +#ifdef IRIX_USING_GNU_LD
  4315. +#define IRIX_SUBTARGET_LINK_SPEC \
  4316. + "%{mabi=n32: -melf32bmipn32}%{mabi=64: -melf64bmip}"
  4317. +#else
  4318. + /* Explicitly hide crt symbols that would normally be marked with
  4319. + a "hidden" visibility attribute.
  4320. +
  4321. + We have traditionally disabled this attribute when using the
  4322. + native linker because the native linker's visibility support is
  4323. + not fully-compatible with the GNU linker's. In particular, the
  4324. + native linker does not pull in archive objects purely to resolve
  4325. + references to the object's hidden symbols, whereas the GNU
  4326. + linker does.
  4327. +
  4328. + The gcc build system currently hides symbols in some static
  4329. + libraries (typically libgcov.a or libgcc.a) whenever visibility
  4330. + attributes are supported. On targets with GNU semantics, this
  4331. + makes sure that uses of libx.so symbols in one dynamic object are
  4332. + not resolved to libx.a symbols in another dynamic object. But
  4333. + on targets with IRIX semantics, hiding the symbols prevents the
  4334. + static archive from working at all.
  4335. +
  4336. + It would probably be better to enable visiblity attributes for
  4337. + IRIX ld and disable the static archives versioning. It shouldn't
  4338. + make anything worse, since libx.a symbols are global by default
  4339. + anyway. However, no-one has volunteered to do this yet. */
  4340. +
  4341. +#define IRIX_SUBTARGET_LINK_SPEC \
  4342. + "%{w} -_SYSTYPE_SVR4 -woff 131 \
  4343. + %{shared:-hidden_symbol __dso_handle} \
  4344. + %{mabi=n32: -n32}%{mabi=64: -64}%{!mabi*: -n32}"
  4345. +#endif
  4346. +
  4347. +/* A linker error can empirically be avoided by removing duplicate
  4348. + library search directories. */
  4349. +/* #define LINK_ELIMINATE_DUPLICATE_LDIRECTORIES 1 */
  4350. +
  4351. +/* The SGI linker doesn't understand constructor priorities. */
  4352. +#ifndef IRIX_USING_GNU_LD
  4353. +#define SUPPORTS_INIT_PRIORITY 0
  4354. +#endif
  4355. +
  4356. +/* Add -g to mips.h default to avoid confusing gas with local symbols
  4357. + generated from stabs info. */
  4358. +#undef NM_FLAGS
  4359. +#define NM_FLAGS "-Bng"
  4360. +
  4361. +/* The system header files are C++ aware. */
  4362. +/* ??? Unfortunately, most but not all of the headers are C++ aware.
  4363. + Specifically, curses.h is not, and as a consequence, defining this
  4364. + used to prevent libg++ building. This is no longer the case so
  4365. + define it again to prevent other problems, e.g. with getopt in
  4366. + unistd.h. We still need some way to fix just those files that need
  4367. + fixing. */
  4368. +/*
  4369. +#define NO_IMPLICIT_EXTERN_C 1
  4370. +*/
  4371. +
  4372. +/* -G is incompatible with -KPIC which is the default, so only allow objects
  4373. + in the small data section if the user explicitly asks for it. */
  4374. +#undef MIPS_DEFAULT_GVALUE
  4375. +#define MIPS_DEFAULT_GVALUE 0
  4376. +
  4377. +#define MIPS_TFMODE_FORMAT mips_extended_format
  4378. diff -Naur gcc-9.5.0/gcc/config/mips/iris6.opt gcc-9.5.0-irix/gcc/config/mips/iris6.opt
  4379. --- gcc-9.5.0/gcc/config/mips/iris6.opt 1969-12-31 19:00:00.000000000 +0000
  4380. +++ gcc-9.5.0-irix/gcc/config/mips/iris6.opt 2025-02-13 08:55:07.390915200 +0000
  4381. @@ -0,0 +1,45 @@
  4382. +; IRIX 6.5 options.
  4383. +
  4384. +; Copyright (C) 2011
  4385. +; Free Software Foundation, Inc.
  4386. +;
  4387. +; This file is part of GCC.
  4388. +;
  4389. +; GCC is free software; you can redistribute it and/or modify it under
  4390. +; the terms of the GNU General Public License as published by the Free
  4391. +; Software Foundation; either version 3, or (at your option) any later
  4392. +; version.
  4393. +;
  4394. +; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
  4395. +; WARRANTY; without even the implied warranty of MERCHANTABILITY or
  4396. +; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  4397. +; for more details.
  4398. +;
  4399. +; You should have received a copy of the GNU General Public License
  4400. +; along with GCC; see the file COPYING3. If not see
  4401. +; <http://www.gnu.org/licenses/>.
  4402. +
  4403. +; See the GCC internals manual (options.texi) for a description of
  4404. +; this file's format.
  4405. +
  4406. +; Please try to keep this file in ASCII collating order.
  4407. +
  4408. +bestGnum
  4409. +Driver
  4410. +
  4411. +call_shared
  4412. +Driver
  4413. +
  4414. +exact_version
  4415. +Driver
  4416. +
  4417. +no_archive
  4418. +Driver
  4419. +
  4420. +non_shared
  4421. +Driver
  4422. +
  4423. +pthread
  4424. +Driver
  4425. +
  4426. +; This comment is to ensure we retain the blank line above.
  4427. diff -Naur gcc-9.5.0/gcc/config/mips/irix6-c.c gcc-9.5.0-irix/gcc/config/mips/irix6-c.c
  4428. --- gcc-9.5.0/gcc/config/mips/irix6-c.c 1969-12-31 19:00:00.000000000 +0000
  4429. +++ gcc-9.5.0-irix/gcc/config/mips/irix6-c.c 2025-02-13 08:55:07.392820800 +0000
  4430. @@ -0,0 +1,38 @@
  4431. +/* IRIX 6 support needed only by C/C++ frontends.
  4432. + Copyright (C) 2012 Free Software Foundation, Inc.
  4433. +
  4434. +This file is part of GCC.
  4435. +
  4436. +GCC is free software; you can redistribute it and/or modify
  4437. +it under the terms of the GNU General Public License as published by
  4438. +the Free Software Foundation; either version 3, or (at your option)
  4439. +any later version.
  4440. +
  4441. +GCC is distributed in the hope that it will be useful,
  4442. +but WITHOUT ANY WARRANTY; without even the implied warranty of
  4443. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  4444. +GNU General Public License for more details.
  4445. +
  4446. +You should have received a copy of the GNU General Public License
  4447. +along with GCC; see the file COPYING3. If not see
  4448. +<http://www.gnu.org/licenses/>. */
  4449. +
  4450. +#include "config.h"
  4451. +#include "system.h"
  4452. +#include "coretypes.h"
  4453. +#include "tree.h"
  4454. +#include "tm.h"
  4455. +#include "c-family/c-common.h"
  4456. +
  4457. +/* For C99, intmax_t, uintmax_t are always long long int, otherwise the
  4458. + type differs between 32-bit and 64-bit compilations. */
  4459. +void
  4460. +irix6_c_common_override_options (void)
  4461. +{
  4462. + if (flag_isoc99 || c_dialect_cxx ())
  4463. + long_intmax = 0;
  4464. + else
  4465. + /* Cannot use LONG_TYPE_SIZE == 64. LONG_TYPE_SIZE is only set in
  4466. + mips_option_override after C_COMMON_OVERRIDE_OPTIONS. */
  4467. + long_intmax = mips_abi == ABI_64;
  4468. +}
  4469. diff -Naur gcc-9.5.0/gcc/config/mips/mips.c gcc-9.5.0-irix/gcc/config/mips/mips.c
  4470. --- gcc-9.5.0/gcc/config/mips/mips.c 2022-05-27 03:21:11.007379000 +0000
  4471. +++ gcc-9.5.0-irix/gcc/config/mips/mips.c 2025-02-13 08:55:07.482792800 +0000
  4472. @@ -474,6 +474,12 @@
  4473. enum processor mips_arch;
  4474. const struct mips_cpu_info *mips_arch_info;
  4475.  
  4476. +#if TARGET_IRIX6
  4477. +/* On IRIX 6, intmax_t and uintmax_t depend on __c99, which is only
  4478. + available in C-family compilers. See irix6_c_common_override_options. */
  4479. +int long_intmax = -1;
  4480. +#endif
  4481. +
  4482. /* The processor that we should tune the code for. */
  4483. enum processor mips_tune;
  4484. const struct mips_cpu_info *mips_tune_info;
  4485. @@ -6682,6 +6688,9 @@
  4486. layout_type (record);
  4487. return record;
  4488. }
  4489. + else if (TARGET_IRIX6)
  4490. + /* On IRIX 6, this type is 'char *'. */
  4491. + return build_pointer_type (char_type_node);
  4492. else
  4493. /* Otherwise, we use 'void *'. */
  4494. return ptr_type_node;
  4495. @@ -9883,6 +9892,8 @@
  4496. /* Generate a special section to describe the ABI switches used to
  4497. produce the resultant binary. */
  4498.  
  4499. + if (!TARGET_IRIX6) {
  4500. +
  4501. /* Record the ABI itself. Modern versions of binutils encode
  4502. this information in the ELF header flags, but GDB needs the
  4503. information in order to correctly debug binaries produced by
  4504. @@ -9967,6 +9978,7 @@
  4505. }
  4506. #endif
  4507. #endif
  4508. + }
  4509.  
  4510. /* If TARGET_ABICALLS, tell GAS to generate -KPIC code. */
  4511. if (TARGET_ABICALLS)
  4512. @@ -20174,6 +20186,10 @@
  4513. REAL_MODE_FORMAT (TFmode) = &mips_quad_format;
  4514. }
  4515.  
  4516. +#ifdef MIPS_TFMODE_FORMAT
  4517. + REAL_MODE_FORMAT (TFmode) = &MIPS_TFMODE_FORMAT;
  4518. +#endif
  4519. +
  4520. /* Make sure that the user didn't turn off paired single support when
  4521. MIPS-3D support is requested. */
  4522. if (TARGET_MIPS3D
  4523. diff -Naur gcc-9.5.0/gcc/config/mips/mips.h gcc-9.5.0-irix/gcc/config/mips/mips.h
  4524. --- gcc-9.5.0/gcc/config/mips/mips.h 2022-05-27 03:21:11.007379000 +0000
  4525. +++ gcc-9.5.0-irix/gcc/config/mips/mips.h 2025-02-13 08:55:07.501182400 +0000
  4526. @@ -201,7 +201,9 @@
  4527.  
  4528. /* True if .gpword or .gpdword should be used for switch tables. */
  4529. #define TARGET_GPWORD \
  4530. - (TARGET_ABICALLS && !TARGET_ABSOLUTE_ABICALLS)
  4531. + (TARGET_ABICALLS \
  4532. + && !TARGET_ABSOLUTE_ABICALLS \
  4533. + && !(mips_abi == ABI_64 && TARGET_IRIX6))
  4534.  
  4535. /* True if the output must have a writable .eh_frame.
  4536. See ASM_PREFERRED_EH_DATA_FORMAT for details. */
  4537. diff -Naur gcc-9.5.0/gcc/config/mips/t-irix6 gcc-9.5.0-irix/gcc/config/mips/t-irix6
  4538. --- gcc-9.5.0/gcc/config/mips/t-irix6 2022-05-27 03:21:11.011379000 +0000
  4539. +++ gcc-9.5.0-irix/gcc/config/mips/t-irix6 2025-02-13 08:55:07.520122400 +0000
  4540. @@ -2,3 +2,7 @@
  4541. MULTILIB_DIRNAMES=n32 64
  4542. MULTILIB_MATCHES=
  4543. MULTILIB_OSDIRNAMES=../lib32 ../lib64
  4544. +
  4545. +irix6-c.o: $(srcdir)/config/mips/irix6-c.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
  4546. + tree.h $(TM_H) $(C_COMMON_H)
  4547. + $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
  4548. diff -Naur gcc-9.5.0/gcc/config.gcc gcc-9.5.0-irix/gcc/config.gcc
  4549. --- gcc-9.5.0/gcc/config.gcc 2022-05-27 03:21:10.891379000 +0000
  4550. +++ gcc-9.5.0-irix/gcc/config.gcc 2025-02-13 08:55:07.536148000 +0000
  4551. @@ -2200,6 +2200,28 @@
  4552. cxx_target_objs="${cxx_target_objs} microblaze-c.o"
  4553. tmake_file="${tmake_file} microblaze/t-microblaze"
  4554. ;;
  4555. +mips-sgi-irix6.5*)
  4556. + tm_file="elfos.h ${tm_file} mips/iris6.h"
  4557. + tmake_file="mips/t-irix6 t-slibgcc"
  4558. + c_target_objs="irix6-c.o"
  4559. + cxx_target_objs="irix6-c.o"
  4560. + extra_options="${extra_options} rpath.opt mips/iris6.opt"
  4561. + target_cpu_default="MASK_ABICALLS"
  4562. + tm_defines="${tm_defines} MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_N32"
  4563. + # Only IRIX Development Foundation 1.3 for IRIX 6.5 provides stdint.h.
  4564. + use_gcc_stdint=wrap
  4565. + if test "x$stabs" = xyes
  4566. + then
  4567. + tm_file="${tm_file} dbx.h"
  4568. + fi
  4569. + if test "x$gnu_ld" = xyes
  4570. + then
  4571. + tm_defines="${tm_defines} IRIX_USING_GNU_LD"
  4572. + fi
  4573. + case ${enable_threads}:${have_pthread_h} in
  4574. + "":yes | yes:yes ) thread_file=posix ;;
  4575. + esac
  4576. + ;;
  4577. riscv*-*-linux*)
  4578. tm_file="elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} riscv/linux.h"
  4579. case "x${enable_multilib}" in
  4580. diff -Naur gcc-9.5.0/gcc/config.host gcc-9.5.0-irix/gcc/config.host
  4581. --- gcc-9.5.0/gcc/config.host 2022-05-27 03:21:10.891379000 +0000
  4582. +++ gcc-9.5.0-irix/gcc/config.host 2025-02-13 08:55:07.545857600 +0000
  4583. @@ -133,9 +133,9 @@
  4584. ;;
  4585. esac
  4586. ;;
  4587. - mips*-*-linux*)
  4588. + mips*-*-linux* | mips-sgi-irix6.5*)
  4589. case ${target} in
  4590. - mips*-*-linux*)
  4591. + mips*-*-linux* | mips-sgi-irix6.5*)
  4592. host_extra_gcc_objs="driver-native.o"
  4593. host_xmake_file="${host_xmake_file} mips/x-native"
  4594. ;;
  4595. diff -Naur gcc-9.5.0/gcc/configure gcc-9.5.0-irix/gcc/configure
  4596. --- gcc-9.5.0/gcc/configure 2022-05-27 03:21:46.559548000 +0000
  4597. +++ gcc-9.5.0-irix/gcc/configure 2025-02-13 08:55:07.640701600 +0000
  4598. @@ -7623,8 +7623,17 @@
  4599. ;;
  4600.  
  4601. mips*-*-*)
  4602. + case $host in
  4603. + mips*-sgi-irix*)
  4604. + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: fixed-point is not supported on IRIX, ignored" >&5
  4605. +$as_echo "$as_me: WARNING: fixed-point is not supported on IRIX, ignored" >&2;}
  4606. + enable_fixed_point=no
  4607. + ;;
  4608. + *)
  4609. enable_fixed_point=yes
  4610. ;;
  4611. + esac
  4612. + ;;
  4613. *)
  4614. { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: fixed-point is not supported for this target, ignored" >&5
  4615. $as_echo "$as_me: WARNING: fixed-point is not supported for this target, ignored" >&2;}
  4616. @@ -24845,6 +24854,10 @@
  4617. gcc_cv_ld_dynamic_option="-adefault"
  4618. fi
  4619. ;;
  4620. + # IRIX 6 ld supports -Bstatic/-Bdynamic
  4621. + mips-sgi-irix6.5*)
  4622. + gcc_cv_ld_static_dynamic=yes
  4623. + ;;
  4624. # Solaris 2 ld always supports -Bstatic/-Bdynamic.
  4625. *-*-solaris2*)
  4626. gcc_cv_ld_static_dynamic=yes
  4627. diff -Naur gcc-9.5.0/gcc/configure.ac gcc-9.5.0-irix/gcc/configure.ac
  4628. --- gcc-9.5.0/gcc/configure.ac 2022-05-27 03:21:11.095380000 +0000
  4629. +++ gcc-9.5.0-irix/gcc/configure.ac 2025-02-13 08:55:07.664012000 +0000
  4630. @@ -865,8 +865,16 @@
  4631. ;;
  4632.  
  4633. mips*-*-*)
  4634. + case $host in
  4635. + mips*-sgi-irix*)
  4636. + AC_MSG_WARN([fixed-point is not supported on IRIX, ignored])
  4637. + enable_fixed_point=no
  4638. + ;;
  4639. + *)
  4640. enable_fixed_point=yes
  4641. ;;
  4642. + esac
  4643. + ;;
  4644. *)
  4645. AC_MSG_WARN([fixed-point is not supported for this target, ignored])
  4646. enable_fixed_point=no
  4647. @@ -3781,6 +3789,10 @@
  4648. gcc_cv_ld_dynamic_option="-adefault"
  4649. fi
  4650. ;;
  4651. + # IRIX 6 ld supports -Bstatic/-Bdynamic.
  4652. + mips-sgi-irix6.5*)
  4653. + gcc_cv_ld_static_dynamic=yes
  4654. + ;;
  4655. # Solaris 2 ld always supports -Bstatic/-Bdynamic.
  4656. *-*-solaris2*)
  4657. gcc_cv_ld_static_dynamic=yes
  4658. diff -Naur gcc-9.5.0/gcc/dwarf2cfi.c gcc-9.5.0-irix/gcc/dwarf2cfi.c
  4659. --- gcc-9.5.0/gcc/dwarf2cfi.c 2022-05-27 03:21:11.187380000 +0000
  4660. +++ gcc-9.5.0-irix/gcc/dwarf2cfi.c 2025-02-13 10:34:28.112466400 +0000
  4661. @@ -812,6 +812,7 @@
  4662. cfi->dw_cfi_opc = DW_CFA_def_cfa_offset;
  4663. cfi->dw_cfi_oprnd1.dw_cfi_offset = const_offset;
  4664. }
  4665. +#ifndef SGUG_DEBUGGING_INFO
  4666. else if (new_cfa->offset.is_constant ()
  4667. && known_eq (new_cfa->offset, old_cfa->offset)
  4668. && old_cfa->reg != INVALID_REGNUM
  4669. @@ -826,6 +827,8 @@
  4670. cfi->dw_cfi_opc = DW_CFA_def_cfa_register;
  4671. cfi->dw_cfi_oprnd1.dw_cfi_reg_num = new_cfa->reg;
  4672. }
  4673. +#endif
  4674. +
  4675. else if (new_cfa->indirect == 0
  4676. && new_cfa->offset.is_constant (&const_offset))
  4677. {
  4678. @@ -1371,6 +1374,10 @@
  4679. unsigned int regno = dwf_regno (reg);
  4680. add_cfi_restore (regno);
  4681. update_row_reg_save (cur_row, regno, NULL);
  4682. + if (REG_P (INCOMING_RETURN_ADDR_RTX)
  4683. + && regno == dwf_regno (INCOMING_RETURN_ADDR_RTX)
  4684. + && regno != DWARF_FRAME_RETURN_COLUMN)
  4685. + reg_save (DWARF_FRAME_RETURN_COLUMN, regno, 0);
  4686. }
  4687. }
  4688. }
  4689. @@ -2934,22 +2941,23 @@
  4690. create_pseudo_cfg (void)
  4691. {
  4692. bool saw_barrier, switch_sections;
  4693. - dw_trace_info ti;
  4694. + dw_trace_info ti1;
  4695. + dw_trace_info* ti = &ti1;
  4696. rtx_insn *insn;
  4697. unsigned i;
  4698.  
  4699. /* The first trace begins at the start of the function,
  4700. and begins with the CIE row state. */
  4701. trace_info.create (16);
  4702. - memset (&ti, 0, sizeof (ti));
  4703. - ti.head = get_insns ();
  4704. - ti.beg_row = cie_cfi_row;
  4705. - ti.cfa_store = cie_cfi_row->cfa;
  4706. - ti.cfa_temp.reg = INVALID_REGNUM;
  4707. - trace_info.quick_push (ti);
  4708. + memset (&ti1, 0, sizeof (ti1));
  4709. + ti1.head = get_insns ();
  4710. + ti1.beg_row = cie_cfi_row;
  4711. + ti1.cfa_store = cie_cfi_row->cfa;
  4712. + ti1.cfa_temp.reg = INVALID_REGNUM;
  4713. + ti = trace_info.quick_push (ti1);
  4714.  
  4715. if (cie_return_save)
  4716. - ti.regs_saved_in_regs.safe_push (*cie_return_save);
  4717. + ti->regs_saved_in_regs.safe_push (*cie_return_save);
  4718.  
  4719. /* Walk all the insns, collecting start of trace locations. */
  4720. saw_barrier = false;
  4721. @@ -2971,11 +2979,12 @@
  4722. else if (save_point_p (insn)
  4723. && (LABEL_P (insn) || !saw_barrier))
  4724. {
  4725. - memset (&ti, 0, sizeof (ti));
  4726. - ti.head = insn;
  4727. - ti.switch_sections = switch_sections;
  4728. - ti.id = trace_info.length ();
  4729. - trace_info.safe_push (ti);
  4730. + dw_trace_info ti2;
  4731. + memset (&ti2, 0, sizeof (ti2));
  4732. + ti2.head = insn;
  4733. + ti2.switch_sections = switch_sections;
  4734. + ti2.id = trace_info.length ();
  4735. + ti = trace_info.safe_push (ti2);
  4736.  
  4737. saw_barrier = false;
  4738. switch_sections = false;
  4739. @@ -2986,19 +2995,18 @@
  4740. avoiding stale pointer problems due to reallocation. */
  4741. trace_index
  4742. = new hash_table<trace_info_hasher> (trace_info.length ());
  4743. - dw_trace_info *tp;
  4744. - FOR_EACH_VEC_ELT (trace_info, i, tp)
  4745. + FOR_EACH_VEC_ELT (trace_info, i, ti)
  4746. {
  4747. dw_trace_info **slot;
  4748.  
  4749. if (dump_file)
  4750. - fprintf (dump_file, "Creating trace %u : start at %s %d%s\n", tp->id,
  4751. - rtx_name[(int) GET_CODE (tp->head)], INSN_UID (tp->head),
  4752. - tp->switch_sections ? " (section switch)" : "");
  4753. + fprintf (dump_file, "Creating trace %u : start at %s %d%s\n", ti->id,
  4754. + rtx_name[(int) GET_CODE (ti->head)], INSN_UID (ti->head),
  4755. + ti->switch_sections ? " (section switch)" : "");
  4756.  
  4757. - slot = trace_index->find_slot_with_hash (tp, INSN_UID (tp->head), INSERT);
  4758. + slot = trace_index->find_slot_with_hash (ti, INSN_UID (ti->head), INSERT);
  4759. gcc_assert (*slot == NULL);
  4760. - *slot = tp;
  4761. + *slot = ti;
  4762. }
  4763. }
  4764.  
  4765. @@ -3574,6 +3582,10 @@
  4766. {
  4767. int enc;
  4768.  
  4769. +#ifdef SGUG_DEBUGGING_INFO
  4770. + return false;
  4771. +#endif
  4772. +
  4773. if (saved_do_cfi_asm != 0)
  4774. return saved_do_cfi_asm > 0;
  4775.  
  4776. diff -Naur gcc-9.5.0/gcc/dwarf2out.c gcc-9.5.0-irix/gcc/dwarf2out.c
  4777. --- gcc-9.5.0/gcc/dwarf2out.c 2022-05-27 03:21:11.187380000 +0000
  4778. +++ gcc-9.5.0-irix/gcc/dwarf2out.c 2025-02-13 08:55:07.784152800 +0000
  4779. @@ -953,6 +953,12 @@
  4780.  
  4781. if (for_eh && targetm.terminate_dw2_eh_frame_info)
  4782. dw2_asm_output_data (4, 0, "End of Table");
  4783. +#ifdef SGUG_DEBUGGING_INFO
  4784. + /* Work around Irix 6 assembler bug whereby labels at the end of a section
  4785. + get a value of 0. Putting .align 0 after the label fixes it. */
  4786. + ASM_OUTPUT_ALIGN (asm_out_file, 0);
  4787. +#endif
  4788. +
  4789.  
  4790. /* Turn off app to make assembly quicker. */
  4791. if (flag_debug_asm)
  4792. @@ -4834,6 +4840,20 @@
  4793. a->dw_attr_val.v.val_die_ref.external = i;
  4794. }
  4795.  
  4796. +/* Add an FDE reference attribute value to a DIE. */
  4797. +
  4798. +static inline void
  4799. +add_AT_fde_ref (dw_die_ref die, enum dwarf_attribute attr_kind, unsigned int targ_fde)
  4800. +{
  4801. + dw_attr_node attr;
  4802. +
  4803. + attr.dw_attr = attr_kind;
  4804. + attr.dw_attr_val.val_class = dw_val_class_fde_ref;
  4805. + attr.dw_attr_val.val_entry = NULL;
  4806. + attr.dw_attr_val.v.val_fde_index = targ_fde;
  4807. + add_dwarf_attr (die, &attr);
  4808. +}
  4809. +
  4810. /* Add a location description attribute value to a DIE. */
  4811.  
  4812. static inline void
  4813. @@ -19461,7 +19481,14 @@
  4814. /* The DWARF2 standard says that we should assume that the structure
  4815. address is already on the stack, so we can specify a structure
  4816. field address by using DW_OP_plus_uconst. */
  4817. +#ifdef SGUG_DEBUGGING_INFO
  4818. + /* ??? The SGI dwarf reader does not handle the DW_OP_plus_uconst
  4819. + operator correctly. It works only if we leave the offset on the
  4820. + stack. */
  4821. + op = DW_OP_constu;
  4822. +#else
  4823. op = DW_OP_plus_uconst;
  4824. +#endif
  4825. loc_descr = new_loc_descr (op, offset, 0);
  4826. }
  4827. }
  4828. @@ -21932,6 +21959,17 @@
  4829. return;
  4830. }
  4831.  
  4832. + /* ??? The SGI dwarf reader fails for array of array of enum types
  4833. + (e.g. const enum machine_mode insn_operand_mode[2][10]) unless the inner
  4834. + array type comes before the outer array type. We thus call gen_type_die
  4835. + before we new_die and must prevent nested array types collapsing for this
  4836. + target. */
  4837. +
  4838. +#ifdef SGUG_DEBUGGING_INFO
  4839. + gen_type_die (TREE_TYPE (type), context_die);
  4840. + collapse_nested_arrays = false;
  4841. +#endif
  4842. +
  4843. array_die = new_die (DW_TAG_array_type, scope_die, type);
  4844. add_name_attribute (array_die, type_tag (type));
  4845. equate_type_number_to_die (type, array_die);
  4846. @@ -21956,6 +21994,14 @@
  4847. for multidimensional arrays. */
  4848. add_AT_unsigned (array_die, DW_AT_ordering, DW_ORD_row_major);
  4849. #endif
  4850. +#ifdef SGUG_DEBUGGING_INFO
  4851. + /* The SGI compilers handle arrays of unknown bound by setting
  4852. + AT_declaration and not emitting any subrange DIEs. */
  4853. + if (TREE_CODE (type) == ARRAY_TYPE
  4854. + && ! TYPE_DOMAIN (type))
  4855. + add_AT_flag (array_die, DW_AT_declaration, 1);
  4856. + else
  4857. +#endif
  4858.  
  4859. if (TREE_CODE (type) == VECTOR_TYPE)
  4860. {
  4861. @@ -21979,6 +22025,10 @@
  4862. element_type = TREE_TYPE (element_type);
  4863. }
  4864.  
  4865. +#ifndef SGUG_DEBUGGING_INFO
  4866. + gen_type_die (element_type, context_die);
  4867. +#endif
  4868. +
  4869. add_type_attribute (array_die, element_type, TYPE_UNQUALIFIED,
  4870. TREE_CODE (type) == ARRAY_TYPE
  4871. && TYPE_REVERSE_STORAGE_ORDER (type),
  4872. @@ -23290,6 +23340,11 @@
  4873. false);
  4874. }
  4875.  
  4876. +#ifdef SGUG_DEBUGGING_INFO
  4877. + /* Add a reference to the FDE for this routine. */
  4878. + add_AT_fde_ref (subr_die, DW_AT_MIPS_fde, cfun->fde->fde_index);
  4879. +#endif
  4880. +
  4881. cfa_fb_offset = CFA_FRAME_BASE_OFFSET (decl);
  4882.  
  4883. /* We define the "frame base" as the function's CFA. This is more
  4884. @@ -24551,6 +24606,24 @@
  4885. sprintf (tail, "%s %s", language_string, version_string);
  4886. tail += plen;
  4887.  
  4888. + if (!dwarf_record_gcc_switches)
  4889. + {
  4890. +#ifdef SGUG_DEBUGGING_INFO
  4891. + /* The MIPS/SGI compilers place the 'cc' command line options in the
  4892. + producer string. The SGI debugger looks for -g, -g1, -g2, or -g3;
  4893. + if they do not appear in the producer string, the debugger reaches
  4894. + the conclusion that the object file is stripped and has no debugging
  4895. + information. To get the MIPS/SGI debugger to believe that there is
  4896. + debugging information in the object file, we add a -g to the producer
  4897. + string. */
  4898. + if (debug_info_level > DINFO_LEVEL_TERSE)
  4899. + {
  4900. + memcpy (tail, " -g", 3);
  4901. + tail += 3;
  4902. + }
  4903. +#endif
  4904. + }
  4905. +
  4906. FOR_EACH_VEC_ELT (switches, j, p)
  4907. {
  4908. len = strlen (p);
  4909. diff -Naur gcc-9.5.0/gmp-6.1.0/gmp-h.in gcc-9.5.0-irix/gmp-6.1.0/gmp-h.in
  4910. --- gcc-9.5.0/gmp-6.1.0/gmp-h.in 2015-11-01 10:19:48.000000000 +0000
  4911. +++ gcc-9.5.0-irix/gmp-6.1.0/gmp-h.in 2021-06-12 23:32:57.898264800 +0000
  4912. @@ -289,6 +289,10 @@
  4913. application uses for gmp_vprintf etc will almost certainly require the
  4914. whole <stdarg.h> anyway. */
  4915.  
  4916. +
  4917. +#ifdef __sgi
  4918. + typedef char *va_list;
  4919. +#endif
  4920. #ifdef va_start
  4921. #define _GMP_H_HAVE_VA_LIST 1
  4922. #endif
  4923. @@ -470,8 +474,10 @@
  4924.  
  4925. #if defined (__cplusplus)
  4926. extern "C" {
  4927. +#ifndef __sgi
  4928. using std::FILE;
  4929. #endif
  4930. +#endif
  4931.  
  4932. #define mp_set_memory_functions __gmp_set_memory_functions
  4933. __GMP_DECLSPEC void mp_set_memory_functions (void *(*) (size_t),
  4934. diff -Naur gcc-9.5.0/gmp-6.1.0/gmp-impl.h gcc-9.5.0-irix/gmp-6.1.0/gmp-impl.h
  4935. --- gcc-9.5.0/gmp-6.1.0/gmp-impl.h 2015-11-01 10:19:48.000000000 +0000
  4936. +++ gcc-9.5.0-irix/gmp-6.1.0/gmp-impl.h 2021-06-12 23:31:19.783849600 +0000
  4937. @@ -229,6 +229,9 @@
  4938.  
  4939. /* gmp_uint_least32_t is an unsigned integer type with at least 32 bits. */
  4940. #if HAVE_UINT_LEAST32_T
  4941. +#ifdef __sgi
  4942. + typedef unsigned int uint_least32_t;
  4943. +#endif
  4944. typedef uint_least32_t gmp_uint_least32_t;
  4945. #else
  4946. #if SIZEOF_UNSIGNED_SHORT >= 4
  4947. diff -Naur gcc-9.5.0/include/libiberty.h gcc-9.5.0-irix/include/libiberty.h
  4948. --- gcc-9.5.0/include/libiberty.h 2022-05-27 03:21:12.791388000 +0000
  4949. +++ gcc-9.5.0-irix/include/libiberty.h 2025-02-13 09:39:06.994597600 +0000
  4950. @@ -109,7 +109,7 @@
  4951. || defined (__FreeBSD__) || defined (__OpenBSD__) || defined (__NetBSD__) \
  4952. || defined (__CYGWIN__) || defined (__CYGWIN32__) || defined (__MINGW32__) \
  4953. || defined (__DragonFly__) || defined (HAVE_DECL_BASENAME)
  4954. -extern char *basename (const char *) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1);
  4955. +extern char *basename (const char *);
  4956. #else
  4957. /* Do not allow basename to be used if there is no prototype seen. We
  4958. either need to use the above prototype or have one from
  4959. @@ -120,18 +120,18 @@
  4960.  
  4961. /* A well-defined basename () that is always compiled in. */
  4962.  
  4963. -extern const char *lbasename (const char *) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1);
  4964. +extern const char *lbasename (const char *) ATTRIBUTE_NONNULL(1);
  4965.  
  4966. /* Same, but assumes DOS semantics (drive name, backslash is also a
  4967. dir separator) regardless of host. */
  4968.  
  4969. -extern const char *dos_lbasename (const char *) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1);
  4970. +extern const char *dos_lbasename (const char *) ATTRIBUTE_NONNULL(1);
  4971.  
  4972. /* Same, but assumes Unix semantics (absolute paths always start with
  4973. a slash, only forward slash is accepted as dir separator)
  4974. regardless of host. */
  4975.  
  4976. -extern const char *unix_lbasename (const char *) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1);
  4977. +extern const char *unix_lbasename (const char *) ATTRIBUTE_NONNULL(1);
  4978.  
  4979. /* A well-defined realpath () that is always compiled in. */
  4980.  
  4981. @@ -141,7 +141,7 @@
  4982. the last argument of this function, to terminate the list of
  4983. strings. Allocates memory using xmalloc. */
  4984.  
  4985. -extern char *concat (const char *, ...) ATTRIBUTE_MALLOC ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_SENTINEL;
  4986. +extern char *concat (const char *, ...) ATTRIBUTE_MALLOC ATTRIBUTE_SENTINEL;
  4987.  
  4988. /* Concatenate an arbitrary number of strings. You must pass NULL as
  4989. the last argument of this function, to terminate the list of
  4990. @@ -150,7 +150,7 @@
  4991. pointer to be freed after the new string is created, similar to the
  4992. way xrealloc works. */
  4993.  
  4994. -extern char *reconcat (char *, const char *, ...) ATTRIBUTE_MALLOC ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_SENTINEL;
  4995. +extern char *reconcat (char *, const char *, ...) ATTRIBUTE_MALLOC ATTRIBUTE_SENTINEL;
  4996.  
  4997. /* Determine the length of concatenating an arbitrary number of
  4998. strings. You must pass NULL as the last argument of this function,
  4999. @@ -163,14 +163,14 @@
  5000. to terminate the list of strings. The supplied memory is assumed
  5001. to be large enough. */
  5002.  
  5003. -extern char *concat_copy (char *, const char *, ...) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1) ATTRIBUTE_SENTINEL;
  5004. +extern char *concat_copy (char *, const char *, ...) ATTRIBUTE_NONNULL(1) ATTRIBUTE_SENTINEL;
  5005.  
  5006. /* Concatenate an arbitrary number of strings into a GLOBAL area of
  5007. memory. You must pass NULL as the last argument of this function,
  5008. to terminate the list of strings. The supplied memory is assumed
  5009. to be large enough. */
  5010.  
  5011. -extern char *concat_copy2 (const char *, ...) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_SENTINEL;
  5012. +extern char *concat_copy2 (const char *, ...) ATTRIBUTE_SENTINEL;
  5013.  
  5014. /* This is the global area used by concat_copy2. */
  5015.  
  5016. @@ -229,11 +229,11 @@
  5017. /* Returns a pointer to a directory path suitable for creating temporary
  5018. files in. */
  5019.  
  5020. -extern const char *choose_tmpdir (void) ATTRIBUTE_RETURNS_NONNULL;
  5021. +extern const char *choose_tmpdir (void) ;
  5022.  
  5023. /* Choose a temporary directory to use for scratch files. */
  5024.  
  5025. -extern char *choose_temp_base (void) ATTRIBUTE_MALLOC ATTRIBUTE_RETURNS_NONNULL;
  5026. +extern char *choose_temp_base (void) ATTRIBUTE_MALLOC ;
  5027.  
  5028. /* Return a temporary file name or NULL if unable to create one. */
  5029.  
  5030. @@ -268,7 +268,7 @@
  5031.  
  5032. /* ANSI's strerror(), but more robust. */
  5033.  
  5034. -extern char *xstrerror (int) ATTRIBUTE_RETURNS_NONNULL;
  5035. +extern char *xstrerror (int) ;
  5036.  
  5037. /* Return the maximum signal number for which strsignal will return a
  5038. string. */
  5039. @@ -310,30 +310,30 @@
  5040. message to stderr (using the name set by xmalloc_set_program_name,
  5041. if any) and then call xexit. */
  5042.  
  5043. -extern void *xmalloc (size_t) ATTRIBUTE_MALLOC ATTRIBUTE_RETURNS_NONNULL;
  5044. +extern void *xmalloc (size_t) ATTRIBUTE_MALLOC ;
  5045.  
  5046. /* Reallocate memory without fail. This works like xmalloc. Note,
  5047. realloc type functions are not suitable for attribute malloc since
  5048. they may return the same address across multiple calls. */
  5049.  
  5050. -extern void *xrealloc (void *, size_t) ATTRIBUTE_RETURNS_NONNULL;
  5051. +extern void *xrealloc (void *, size_t) ;
  5052.  
  5053. /* Allocate memory without fail and set it to zero. This works like
  5054. xmalloc. */
  5055.  
  5056. -extern void *xcalloc (size_t, size_t) ATTRIBUTE_MALLOC ATTRIBUTE_RETURNS_NONNULL;
  5057. +extern void *xcalloc (size_t, size_t) ATTRIBUTE_MALLOC ;
  5058.  
  5059. /* Copy a string into a memory buffer without fail. */
  5060.  
  5061. -extern char *xstrdup (const char *) ATTRIBUTE_MALLOC ATTRIBUTE_RETURNS_NONNULL;
  5062. +extern char *xstrdup (const char *) ATTRIBUTE_MALLOC ;
  5063.  
  5064. /* Copy at most N characters from string into a buffer without fail. */
  5065.  
  5066. -extern char *xstrndup (const char *, size_t) ATTRIBUTE_MALLOC ATTRIBUTE_RETURNS_NONNULL;
  5067. +extern char *xstrndup (const char *, size_t) ATTRIBUTE_MALLOC ;
  5068.  
  5069. /* Copy an existing memory buffer to a new memory buffer without fail. */
  5070.  
  5071. -extern void *xmemdup (const void *, size_t, size_t) ATTRIBUTE_MALLOC ATTRIBUTE_RETURNS_NONNULL;
  5072. +extern void *xmemdup (const void *, size_t, size_t) ATTRIBUTE_MALLOC ;
  5073.  
  5074. /* Physical memory routines. Return values are in BYTES. */
  5075. extern double physmem_total (void);
  5076. @@ -422,7 +422,7 @@
  5077. Returns NULL on error. */
  5078.  
  5079. extern struct pex_obj *pex_init (int flags, const char *pname,
  5080. - const char *tempbase) ATTRIBUTE_RETURNS_NONNULL;
  5081. + const char *tempbase) ;
  5082.  
  5083. /* Flags for pex_run. These are bits to be or'ed together. */
  5084.  
  5085. diff -Naur gcc-9.5.0/isl-0.18/isl_schedule_tree.c gcc-9.5.0-irix/isl-0.18/isl_schedule_tree.c
  5086. --- gcc-9.5.0/isl-0.18/isl_schedule_tree.c 2016-12-15 06:27:30.000000000 +0000
  5087. +++ gcc-9.5.0-irix/isl-0.18/isl_schedule_tree.c 2024-12-22 11:54:48.326403200 +0000
  5088. @@ -84,45 +84,45 @@
  5089. "allocation should have failed",
  5090. isl_schedule_tree_free(dup));
  5091. case isl_schedule_node_band:
  5092. - dup->band = isl_schedule_band_copy(tree->band);
  5093. - if (!dup->band)
  5094. + dup->anonunion.band = isl_schedule_band_copy(tree->anonunion.band);
  5095. + if (!dup->anonunion.band)
  5096. return isl_schedule_tree_free(dup);
  5097. break;
  5098. case isl_schedule_node_context:
  5099. - dup->context = isl_set_copy(tree->context);
  5100. - if (!dup->context)
  5101. + dup->anonunion.context = isl_set_copy(tree->anonunion.context);
  5102. + if (!dup->anonunion.context)
  5103. return isl_schedule_tree_free(dup);
  5104. break;
  5105. case isl_schedule_node_domain:
  5106. - dup->domain = isl_union_set_copy(tree->domain);
  5107. - if (!dup->domain)
  5108. + dup->anonunion.domain = isl_union_set_copy(tree->anonunion.domain);
  5109. + if (!dup->anonunion.domain)
  5110. return isl_schedule_tree_free(dup);
  5111. break;
  5112. case isl_schedule_node_expansion:
  5113. - dup->contraction =
  5114. - isl_union_pw_multi_aff_copy(tree->contraction);
  5115. - dup->expansion = isl_union_map_copy(tree->expansion);
  5116. - if (!dup->contraction || !dup->expansion)
  5117. + dup->anonunion.anonstruct.contraction =
  5118. + isl_union_pw_multi_aff_copy(tree->anonunion.anonstruct.contraction);
  5119. + dup->anonunion.anonstruct.expansion = isl_union_map_copy(tree->anonunion.anonstruct.expansion);
  5120. + if (!dup->anonunion.anonstruct.contraction || !dup->anonunion.anonstruct.expansion)
  5121. return isl_schedule_tree_free(dup);
  5122. break;
  5123. case isl_schedule_node_extension:
  5124. - dup->extension = isl_union_map_copy(tree->extension);
  5125. - if (!dup->extension)
  5126. + dup->anonunion.extension = isl_union_map_copy(tree->anonunion.extension);
  5127. + if (!dup->anonunion.extension)
  5128. return isl_schedule_tree_free(dup);
  5129. break;
  5130. case isl_schedule_node_filter:
  5131. - dup->filter = isl_union_set_copy(tree->filter);
  5132. - if (!dup->filter)
  5133. + dup->anonunion.filter = isl_union_set_copy(tree->anonunion.filter);
  5134. + if (!dup->anonunion.filter)
  5135. return isl_schedule_tree_free(dup);
  5136. break;
  5137. case isl_schedule_node_guard:
  5138. - dup->guard = isl_set_copy(tree->guard);
  5139. - if (!dup->guard)
  5140. + dup->anonunion.guard = isl_set_copy(tree->anonunion.guard);
  5141. + if (!dup->anonunion.guard)
  5142. return isl_schedule_tree_free(dup);
  5143. break;
  5144. case isl_schedule_node_mark:
  5145. - dup->mark = isl_id_copy(tree->mark);
  5146. - if (!dup->mark)
  5147. + dup->anonunion.mark = isl_id_copy(tree->anonunion.mark);
  5148. + if (!dup->anonunion.mark)
  5149. return isl_schedule_tree_free(dup);
  5150. break;
  5151. case isl_schedule_node_leaf:
  5152. @@ -180,29 +180,29 @@
  5153.  
  5154. switch (tree->type) {
  5155. case isl_schedule_node_band:
  5156. - isl_schedule_band_free(tree->band);
  5157. + isl_schedule_band_free(tree->anonunion.band);
  5158. break;
  5159. case isl_schedule_node_context:
  5160. - isl_set_free(tree->context);
  5161. + isl_set_free(tree->anonunion.context);
  5162. break;
  5163. case isl_schedule_node_domain:
  5164. - isl_union_set_free(tree->domain);
  5165. + isl_union_set_free(tree->anonunion.domain);
  5166. break;
  5167. case isl_schedule_node_expansion:
  5168. - isl_union_pw_multi_aff_free(tree->contraction);
  5169. - isl_union_map_free(tree->expansion);
  5170. + isl_union_pw_multi_aff_free(tree->anonunion.anonstruct.contraction);
  5171. + isl_union_map_free(tree->anonunion.anonstruct.expansion);
  5172. break;
  5173. case isl_schedule_node_extension:
  5174. - isl_union_map_free(tree->extension);
  5175. + isl_union_map_free(tree->anonunion.extension);
  5176. break;
  5177. case isl_schedule_node_filter:
  5178. - isl_union_set_free(tree->filter);
  5179. + isl_union_set_free(tree->anonunion.filter);
  5180. break;
  5181. case isl_schedule_node_guard:
  5182. - isl_set_free(tree->guard);
  5183. + isl_set_free(tree->anonunion.guard);
  5184. break;
  5185. case isl_schedule_node_mark:
  5186. - isl_id_free(tree->mark);
  5187. + isl_id_free(tree->anonunion.mark);
  5188. break;
  5189. case isl_schedule_node_sequence:
  5190. case isl_schedule_node_set:
  5191. @@ -241,7 +241,7 @@
  5192. if (!tree)
  5193. goto error;
  5194.  
  5195. - tree->band = band;
  5196. + tree->anonunion.band = band;
  5197. tree->anchored = isl_schedule_band_is_anchored(band);
  5198.  
  5199. return tree;
  5200. @@ -268,7 +268,7 @@
  5201. if (!tree)
  5202. goto error;
  5203.  
  5204. - tree->context = context;
  5205. + tree->anonunion.context = context;
  5206. tree->anchored = 1;
  5207.  
  5208. return tree;
  5209. @@ -293,7 +293,7 @@
  5210. if (!tree)
  5211. goto error;
  5212.  
  5213. - tree->domain = domain;
  5214. + tree->anonunion.domain = domain;
  5215.  
  5216. return tree;
  5217. error:
  5218. @@ -319,8 +319,8 @@
  5219. if (!tree)
  5220. goto error;
  5221.  
  5222. - tree->contraction = contraction;
  5223. - tree->expansion = expansion;
  5224. + tree->anonunion.anonstruct.contraction = contraction;
  5225. + tree->anonunion.anonstruct.expansion = expansion;
  5226.  
  5227. return tree;
  5228. error:
  5229. @@ -348,7 +348,7 @@
  5230. if (!tree)
  5231. goto error;
  5232.  
  5233. - tree->extension = extension;
  5234. + tree->anonunion.extension = extension;
  5235. tree->anchored = 1;
  5236.  
  5237. return tree;
  5238. @@ -373,7 +373,7 @@
  5239. if (!tree)
  5240. goto error;
  5241.  
  5242. - tree->filter = filter;
  5243. + tree->anonunion.filter = filter;
  5244.  
  5245. return tree;
  5246. error:
  5247. @@ -399,7 +399,7 @@
  5248. if (!tree)
  5249. goto error;
  5250.  
  5251. - tree->guard = guard;
  5252. + tree->anonunion.guard = guard;
  5253. tree->anchored = 1;
  5254.  
  5255. return tree;
  5256. @@ -425,7 +425,7 @@
  5257. if (!tree)
  5258. goto error;
  5259.  
  5260. - tree->mark = mark;
  5261. + tree->anonunion.mark = mark;
  5262.  
  5263. return tree;
  5264. error:
  5265. @@ -456,7 +456,7 @@
  5266. case isl_schedule_node_error:
  5267. return -1;
  5268. case isl_schedule_node_band:
  5269. - return isl_schedule_band_is_anchored(tree->band);
  5270. + return isl_schedule_band_is_anchored(tree->anonunion.band);
  5271. case isl_schedule_node_context:
  5272. case isl_schedule_node_extension:
  5273. case isl_schedule_node_guard:
  5274. @@ -639,34 +639,34 @@
  5275.  
  5276. switch (tree1->type) {
  5277. case isl_schedule_node_band:
  5278. - equal = isl_schedule_band_plain_is_equal(tree1->band,
  5279. - tree2->band);
  5280. + equal = isl_schedule_band_plain_is_equal(tree1->anonunion.band,
  5281. + tree2->anonunion.band);
  5282. break;
  5283. case isl_schedule_node_context:
  5284. - equal = isl_set_is_equal(tree1->context, tree2->context);
  5285. + equal = isl_set_is_equal(tree1->anonunion.context, tree2->anonunion.context);
  5286. break;
  5287. case isl_schedule_node_domain:
  5288. - equal = isl_union_set_is_equal(tree1->domain, tree2->domain);
  5289. + equal = isl_union_set_is_equal(tree1->anonunion.domain, tree2->anonunion.domain);
  5290. break;
  5291. case isl_schedule_node_expansion:
  5292. - equal = isl_union_map_is_equal(tree1->expansion,
  5293. - tree2->expansion);
  5294. + equal = isl_union_map_is_equal(tree1->anonunion.anonstruct.expansion,
  5295. + tree2->anonunion.anonstruct.expansion);
  5296. if (equal >= 0 && equal)
  5297. equal = isl_union_pw_multi_aff_plain_is_equal(
  5298. - tree1->contraction, tree2->contraction);
  5299. + tree1->anonunion.anonstruct.contraction, tree2->anonunion.anonstruct.contraction);
  5300. break;
  5301. case isl_schedule_node_extension:
  5302. - equal = isl_union_map_is_equal(tree1->extension,
  5303. - tree2->extension);
  5304. + equal = isl_union_map_is_equal(tree1->anonunion.extension,
  5305. + tree2->anonunion.extension);
  5306. break;
  5307. case isl_schedule_node_filter:
  5308. - equal = isl_union_set_is_equal(tree1->filter, tree2->filter);
  5309. + equal = isl_union_set_is_equal(tree1->anonunion.filter, tree2->anonunion.filter);
  5310. break;
  5311. case isl_schedule_node_guard:
  5312. - equal = isl_set_is_equal(tree1->guard, tree2->guard);
  5313. + equal = isl_set_is_equal(tree1->anonunion.guard, tree2->anonunion.guard);
  5314. break;
  5315. case isl_schedule_node_mark:
  5316. - equal = tree1->mark == tree2->mark;
  5317. + equal = tree1->anonunion.mark == tree2->anonunion.mark;
  5318. break;
  5319. case isl_schedule_node_leaf:
  5320. case isl_schedule_node_sequence:
  5321. @@ -1002,7 +1002,7 @@
  5322. isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  5323. "not a band node", return 0);
  5324.  
  5325. - return isl_schedule_band_n_member(tree->band);
  5326. + return isl_schedule_band_n_member(tree->anonunion.band);
  5327. }
  5328.  
  5329. /* Is the band member at position "pos" of the band tree root
  5330. @@ -1018,7 +1018,7 @@
  5331. isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  5332. "not a band node", return isl_bool_error);
  5333.  
  5334. - return isl_schedule_band_member_get_coincident(tree->band, pos);
  5335. + return isl_schedule_band_member_get_coincident(tree->anonunion.band, pos);
  5336. }
  5337.  
  5338. /* Mark the given band member as being coincident or not
  5339. @@ -1039,9 +1039,9 @@
  5340. if (!tree)
  5341. return NULL;
  5342.  
  5343. - tree->band = isl_schedule_band_member_set_coincident(tree->band, pos,
  5344. + tree->anonunion.band = isl_schedule_band_member_set_coincident(tree->anonunion.band, pos,
  5345. coincident);
  5346. - if (!tree->band)
  5347. + if (!tree->anonunion.band)
  5348. return isl_schedule_tree_free(tree);
  5349. return tree;
  5350. }
  5351. @@ -1058,7 +1058,7 @@
  5352. isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  5353. "not a band node", return isl_bool_error);
  5354.  
  5355. - return isl_schedule_band_get_permutable(tree->band);
  5356. + return isl_schedule_band_get_permutable(tree->anonunion.band);
  5357. }
  5358.  
  5359. /* Mark the band tree root permutable or not according to "permutable"?
  5360. @@ -1077,8 +1077,8 @@
  5361. if (!tree)
  5362. return NULL;
  5363.  
  5364. - tree->band = isl_schedule_band_set_permutable(tree->band, permutable);
  5365. - if (!tree->band)
  5366. + tree->anonunion.band = isl_schedule_band_set_permutable(tree->anonunion.band, permutable);
  5367. + if (!tree->anonunion.band)
  5368. return isl_schedule_tree_free(tree);
  5369. return tree;
  5370. }
  5371. @@ -1095,7 +1095,7 @@
  5372. isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  5373. "not a band node", return NULL);
  5374.  
  5375. - return isl_schedule_band_get_space(tree->band);
  5376. + return isl_schedule_band_get_space(tree->anonunion.band);
  5377. }
  5378.  
  5379. /* Intersect the domain of the band schedule of the band tree root
  5380. @@ -1111,8 +1111,8 @@
  5381. isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  5382. "not a band node", goto error);
  5383.  
  5384. - tree->band = isl_schedule_band_intersect_domain(tree->band, domain);
  5385. - if (!tree->band)
  5386. + tree->anonunion.band = isl_schedule_band_intersect_domain(tree->anonunion.band, domain);
  5387. + if (!tree->anonunion.band)
  5388. return isl_schedule_tree_free(tree);
  5389.  
  5390. return tree;
  5391. @@ -1134,7 +1134,7 @@
  5392. isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  5393. "not a band node", return NULL);
  5394.  
  5395. - return isl_schedule_band_get_partial_schedule(tree->band);
  5396. + return isl_schedule_band_get_partial_schedule(tree->anonunion.band);
  5397. }
  5398.  
  5399. /* Replace the schedule of the band tree root by "schedule".
  5400. @@ -1150,7 +1150,7 @@
  5401. if (tree->type != isl_schedule_node_band)
  5402. isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  5403. "not a band node", return NULL);
  5404. - tree->band = isl_schedule_band_set_partial_schedule(tree->band,
  5405. + tree->anonunion.band = isl_schedule_band_set_partial_schedule(tree->anonunion.band,
  5406. schedule);
  5407.  
  5408. return tree;
  5409. @@ -1173,7 +1173,7 @@
  5410. isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  5411. "not a band node", return isl_ast_loop_error);
  5412.  
  5413. - return isl_schedule_band_member_get_ast_loop_type(tree->band, pos);
  5414. + return isl_schedule_band_member_get_ast_loop_type(tree->anonunion.band, pos);
  5415. }
  5416.  
  5417. /* Set the loop AST generation type for the band member of the band tree root
  5418. @@ -1191,9 +1191,9 @@
  5419. isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  5420. "not a band node", return isl_schedule_tree_free(tree));
  5421.  
  5422. - tree->band = isl_schedule_band_member_set_ast_loop_type(tree->band,
  5423. + tree->anonunion.band = isl_schedule_band_member_set_ast_loop_type(tree->anonunion.band,
  5424. pos, type);
  5425. - if (!tree->band)
  5426. + if (!tree->anonunion.band)
  5427. return isl_schedule_tree_free(tree);
  5428.  
  5429. return tree;
  5430. @@ -1212,7 +1212,7 @@
  5431. isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  5432. "not a band node", return isl_ast_loop_error);
  5433.  
  5434. - return isl_schedule_band_member_get_isolate_ast_loop_type(tree->band,
  5435. + return isl_schedule_band_member_get_isolate_ast_loop_type(tree->anonunion.band,
  5436. pos);
  5437. }
  5438.  
  5439. @@ -1232,9 +1232,9 @@
  5440. isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  5441. "not a band node", return isl_schedule_tree_free(tree));
  5442.  
  5443. - tree->band = isl_schedule_band_member_set_isolate_ast_loop_type(
  5444. - tree->band, pos, type);
  5445. - if (!tree->band)
  5446. + tree->anonunion.band = isl_schedule_band_member_set_isolate_ast_loop_type(
  5447. + tree->anonunion.band, pos, type);
  5448. + if (!tree->anonunion.band)
  5449. return isl_schedule_tree_free(tree);
  5450.  
  5451. return tree;
  5452. @@ -1252,7 +1252,7 @@
  5453. isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  5454. "not a band node", return NULL);
  5455.  
  5456. - return isl_schedule_band_get_ast_build_options(tree->band);
  5457. + return isl_schedule_band_get_ast_build_options(tree->anonunion.band);
  5458. }
  5459.  
  5460. /* Replace the AST build options associated to band tree root by "options".
  5461. @@ -1273,9 +1273,9 @@
  5462. "not a band node", goto error);
  5463.  
  5464. was_anchored = isl_schedule_tree_is_anchored(tree);
  5465. - tree->band = isl_schedule_band_set_ast_build_options(tree->band,
  5466. + tree->anonunion.band = isl_schedule_band_set_ast_build_options(tree->anonunion.band,
  5467. options);
  5468. - if (!tree->band)
  5469. + if (!tree->anonunion.band)
  5470. return isl_schedule_tree_free(tree);
  5471. if (isl_schedule_tree_is_anchored(tree) != was_anchored)
  5472. tree = isl_schedule_tree_update_anchored(tree);
  5473. @@ -1300,7 +1300,7 @@
  5474. isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  5475. "not a band node", return NULL);
  5476.  
  5477. - return isl_schedule_band_get_ast_isolate_option(tree->band, depth);
  5478. + return isl_schedule_band_get_ast_isolate_option(tree->anonunion.band, depth);
  5479. }
  5480.  
  5481. /* Return the context of the context tree root.
  5482. @@ -1315,7 +1315,7 @@
  5483. isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  5484. "not a context node", return NULL);
  5485.  
  5486. - return isl_set_copy(tree->context);
  5487. + return isl_set_copy(tree->anonunion.context);
  5488. }
  5489.  
  5490. /* Return the domain of the domain tree root.
  5491. @@ -1330,7 +1330,7 @@
  5492. isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  5493. "not a domain node", return NULL);
  5494.  
  5495. - return isl_union_set_copy(tree->domain);
  5496. + return isl_union_set_copy(tree->anonunion.domain);
  5497. }
  5498.  
  5499. /* Replace the domain of domain tree root "tree" by "domain".
  5500. @@ -1346,8 +1346,8 @@
  5501. isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  5502. "not a domain node", goto error);
  5503.  
  5504. - isl_union_set_free(tree->domain);
  5505. - tree->domain = domain;
  5506. + isl_union_set_free(tree->anonunion.domain);
  5507. + tree->anonunion.domain = domain;
  5508.  
  5509. return tree;
  5510. error:
  5511. @@ -1368,7 +1368,7 @@
  5512. isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  5513. "not an expansion node", return NULL);
  5514.  
  5515. - return isl_union_pw_multi_aff_copy(tree->contraction);
  5516. + return isl_union_pw_multi_aff_copy(tree->anonunion.anonstruct.contraction);
  5517. }
  5518.  
  5519. /* Return the expansion of the expansion tree root.
  5520. @@ -1383,7 +1383,7 @@
  5521. isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  5522. "not an expansion node", return NULL);
  5523.  
  5524. - return isl_union_map_copy(tree->expansion);
  5525. + return isl_union_map_copy(tree->anonunion.anonstruct.expansion);
  5526. }
  5527.  
  5528. /* Replace the contraction and the expansion of the expansion tree root "tree"
  5529. @@ -1403,10 +1403,10 @@
  5530. isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  5531. "not an expansion node", return NULL);
  5532.  
  5533. - isl_union_pw_multi_aff_free(tree->contraction);
  5534. - tree->contraction = contraction;
  5535. - isl_union_map_free(tree->expansion);
  5536. - tree->expansion = expansion;
  5537. + isl_union_pw_multi_aff_free(tree->anonunion.anonstruct.contraction);
  5538. + tree->anonunion.anonstruct.contraction = contraction;
  5539. + isl_union_map_free(tree->anonunion.anonstruct.expansion);
  5540. + tree->anonunion.anonstruct.expansion = expansion;
  5541.  
  5542. return tree;
  5543. error:
  5544. @@ -1428,7 +1428,7 @@
  5545. isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  5546. "not an extension node", return NULL);
  5547.  
  5548. - return isl_union_map_copy(tree->extension);
  5549. + return isl_union_map_copy(tree->anonunion.extension);
  5550. }
  5551.  
  5552. /* Replace the extension of extension tree root "tree" by "extension".
  5553. @@ -1443,8 +1443,8 @@
  5554. if (tree->type != isl_schedule_node_extension)
  5555. isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  5556. "not an extension node", return NULL);
  5557. - isl_union_map_free(tree->extension);
  5558. - tree->extension = extension;
  5559. + isl_union_map_free(tree->anonunion.extension);
  5560. + tree->anonunion.extension = extension;
  5561.  
  5562. return tree;
  5563. error:
  5564. @@ -1465,7 +1465,7 @@
  5565. isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  5566. "not a filter node", return NULL);
  5567.  
  5568. - return isl_union_set_copy(tree->filter);
  5569. + return isl_union_set_copy(tree->anonunion.filter);
  5570. }
  5571.  
  5572. /* Replace the filter of the filter tree root by "filter".
  5573. @@ -1481,8 +1481,8 @@
  5574. isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  5575. "not a filter node", return NULL);
  5576.  
  5577. - isl_union_set_free(tree->filter);
  5578. - tree->filter = filter;
  5579. + isl_union_set_free(tree->anonunion.filter);
  5580. + tree->anonunion.filter = filter;
  5581.  
  5582. return tree;
  5583. error:
  5584. @@ -1503,7 +1503,7 @@
  5585. isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  5586. "not a guard node", return NULL);
  5587.  
  5588. - return isl_set_copy(tree->guard);
  5589. + return isl_set_copy(tree->anonunion.guard);
  5590. }
  5591.  
  5592. /* Return the mark identifier of the mark tree root "tree".
  5593. @@ -1518,7 +1518,7 @@
  5594. isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  5595. "not a mark node", return NULL);
  5596.  
  5597. - return isl_id_copy(tree->mark);
  5598. + return isl_id_copy(tree->anonunion.mark);
  5599. }
  5600.  
  5601. /* Set dim to the range dimension of "map" and abort the search.
  5602. @@ -1828,7 +1828,7 @@
  5603. case isl_schedule_node_band:
  5604. if (isl_schedule_tree_band_n_member(tree) == 0)
  5605. return subtree_schedule_extend_child(tree, outer);
  5606. - mupa = isl_schedule_band_get_partial_schedule(tree->band);
  5607. + mupa = isl_schedule_band_get_partial_schedule(tree->anonunion.band);
  5608. umap = isl_union_map_from_multi_union_pw_aff(mupa);
  5609. outer = isl_union_map_flat_range_product(outer, umap);
  5610. umap = subtree_schedule_extend_child(tree, outer);
  5611. @@ -1940,7 +1940,7 @@
  5612. isl_error_internal,
  5613. "0D band should be handled by caller",
  5614. return NULL);
  5615. - mupa = isl_schedule_band_get_partial_schedule(tree->band);
  5616. + mupa = isl_schedule_band_get_partial_schedule(tree->anonunion.band);
  5617. domain = isl_multi_union_pw_aff_domain(mupa);
  5618. domain = isl_union_set_universe(domain);
  5619. break;
  5620. @@ -2008,8 +2008,8 @@
  5621. if (!tree)
  5622. goto error;
  5623.  
  5624. - tree->band = isl_schedule_band_scale(tree->band, mv);
  5625. - if (!tree->band)
  5626. + tree->anonunion.band = isl_schedule_band_scale(tree->anonunion.band, mv);
  5627. + if (!tree->anonunion.band)
  5628. return isl_schedule_tree_free(tree);
  5629.  
  5630. return tree;
  5631. @@ -2035,8 +2035,8 @@
  5632. if (!tree)
  5633. goto error;
  5634.  
  5635. - tree->band = isl_schedule_band_scale_down(tree->band, mv);
  5636. - if (!tree->band)
  5637. + tree->anonunion.band = isl_schedule_band_scale_down(tree->anonunion.band, mv);
  5638. + if (!tree->anonunion.band)
  5639. return isl_schedule_tree_free(tree);
  5640.  
  5641. return tree;
  5642. @@ -2062,8 +2062,8 @@
  5643. if (!tree)
  5644. goto error;
  5645.  
  5646. - tree->band = isl_schedule_band_mod(tree->band, mv);
  5647. - if (!tree->band)
  5648. + tree->anonunion.band = isl_schedule_band_mod(tree->anonunion.band, mv);
  5649. + if (!tree->anonunion.band)
  5650. return isl_schedule_tree_free(tree);
  5651.  
  5652. return tree;
  5653. @@ -2089,8 +2089,8 @@
  5654. if (!tree)
  5655. goto error;
  5656.  
  5657. - tree->band = isl_schedule_band_shift(tree->band, shift);
  5658. - if (!tree->band)
  5659. + tree->anonunion.band = isl_schedule_band_shift(tree->anonunion.band, shift);
  5660. + if (!tree->anonunion.band)
  5661. return isl_schedule_tree_free(tree);
  5662.  
  5663. return tree;
  5664. @@ -2165,12 +2165,12 @@
  5665. if (!tree || !child)
  5666. goto error;
  5667.  
  5668. - tree->band = isl_schedule_band_tile(tree->band,
  5669. + tree->anonunion.band = isl_schedule_band_tile(tree->anonunion.band,
  5670. isl_multi_val_copy(sizes));
  5671. - if (!tree->band)
  5672. + if (!tree->anonunion.band)
  5673. goto error;
  5674. - child->band = isl_schedule_band_point(child->band, tree->band, sizes);
  5675. - if (!child->band)
  5676. + child->anonunion.band = isl_schedule_band_point(child->anonunion.band, tree->anonunion.band, sizes);
  5677. + if (!child->anonunion.band)
  5678. child = isl_schedule_tree_free(child);
  5679.  
  5680. tree = isl_schedule_tree_replace_child(tree, 0, child);
  5681. @@ -2295,14 +2295,14 @@
  5682. isolate = isl_schedule_tree_band_get_ast_isolate_option(tree, depth);
  5683. tree_isolate = isolate_initial(isolate, pos, n - pos);
  5684. child_isolate = isolate_final(isolate, pos, n - pos);
  5685. - child->band = isl_schedule_band_drop(child->band, 0, pos);
  5686. - child->band = isl_schedule_band_replace_ast_build_option(child->band,
  5687. + child->anonunion.band = isl_schedule_band_drop(child->anonunion.band, 0, pos);
  5688. + child->anonunion.band = isl_schedule_band_replace_ast_build_option(child->anonunion.band,
  5689. isl_set_copy(isolate), child_isolate);
  5690. - tree->band = isl_schedule_band_drop(tree->band, pos, n - pos);
  5691. - tree->band = isl_schedule_band_replace_ast_build_option(tree->band,
  5692. + tree->anonunion.band = isl_schedule_band_drop(tree->anonunion.band, pos, n - pos);
  5693. + tree->anonunion.band = isl_schedule_band_replace_ast_build_option(tree->anonunion.band,
  5694. isl_set_copy(isolate), tree_isolate);
  5695. isl_set_free(isolate);
  5696. - if (!child->band || !tree->band)
  5697. + if (!child->anonunion.band || !tree->anonunion.band)
  5698. goto error;
  5699.  
  5700. tree = isl_schedule_tree_replace_child(tree, 0, child);
  5701. @@ -2369,40 +2369,40 @@
  5702. case isl_schedule_node_error:
  5703. return isl_schedule_tree_free(tree);
  5704. case isl_schedule_node_band:
  5705. - tree->band = isl_schedule_band_reset_user(tree->band);
  5706. - if (!tree->band)
  5707. + tree->anonunion.band = isl_schedule_band_reset_user(tree->anonunion.band);
  5708. + if (!tree->anonunion.band)
  5709. return isl_schedule_tree_free(tree);
  5710. break;
  5711. case isl_schedule_node_context:
  5712. - tree->context = isl_set_reset_user(tree->context);
  5713. - if (!tree->context)
  5714. + tree->anonunion.context = isl_set_reset_user(tree->anonunion.context);
  5715. + if (!tree->anonunion.context)
  5716. return isl_schedule_tree_free(tree);
  5717. break;
  5718. case isl_schedule_node_domain:
  5719. - tree->domain = isl_union_set_reset_user(tree->domain);
  5720. - if (!tree->domain)
  5721. + tree->anonunion.domain = isl_union_set_reset_user(tree->anonunion.domain);
  5722. + if (!tree->anonunion.domain)
  5723. return isl_schedule_tree_free(tree);
  5724. break;
  5725. case isl_schedule_node_expansion:
  5726. - tree->contraction =
  5727. - isl_union_pw_multi_aff_reset_user(tree->contraction);
  5728. - tree->expansion = isl_union_map_reset_user(tree->expansion);
  5729. - if (!tree->contraction || !tree->expansion)
  5730. + tree->anonunion.anonstruct.contraction =
  5731. + isl_union_pw_multi_aff_reset_user(tree->anonunion.anonstruct.contraction);
  5732. + tree->anonunion.anonstruct.expansion = isl_union_map_reset_user(tree->anonunion.anonstruct.expansion);
  5733. + if (!tree->anonunion.anonstruct.contraction || !tree->anonunion.anonstruct.expansion)
  5734. return isl_schedule_tree_free(tree);
  5735. break;
  5736. case isl_schedule_node_extension:
  5737. - tree->extension = isl_union_map_reset_user(tree->extension);
  5738. - if (!tree->extension)
  5739. + tree->anonunion.extension = isl_union_map_reset_user(tree->anonunion.extension);
  5740. + if (!tree->anonunion.extension)
  5741. return isl_schedule_tree_free(tree);
  5742. break;
  5743. case isl_schedule_node_filter:
  5744. - tree->filter = isl_union_set_reset_user(tree->filter);
  5745. - if (!tree->filter)
  5746. + tree->anonunion.filter = isl_union_set_reset_user(tree->anonunion.filter);
  5747. + if (!tree->anonunion.filter)
  5748. return isl_schedule_tree_free(tree);
  5749. break;
  5750. case isl_schedule_node_guard:
  5751. - tree->guard = isl_set_reset_user(tree->guard);
  5752. - if (!tree->guard)
  5753. + tree->anonunion.guard = isl_set_reset_user(tree->anonunion.guard);
  5754. + if (!tree->anonunion.guard)
  5755. return isl_schedule_tree_free(tree);
  5756. break;
  5757. case isl_schedule_node_leaf:
  5758. @@ -2436,43 +2436,43 @@
  5759. case isl_schedule_node_error:
  5760. goto error;
  5761. case isl_schedule_node_band:
  5762. - tree->band = isl_schedule_band_align_params(tree->band, space);
  5763. - if (!tree->band)
  5764. + tree->anonunion.band = isl_schedule_band_align_params(tree->anonunion.band, space);
  5765. + if (!tree->anonunion.band)
  5766. return isl_schedule_tree_free(tree);
  5767. break;
  5768. case isl_schedule_node_context:
  5769. - tree->context = isl_set_align_params(tree->context, space);
  5770. - if (!tree->context)
  5771. + tree->anonunion.context = isl_set_align_params(tree->anonunion.context, space);
  5772. + if (!tree->anonunion.context)
  5773. return isl_schedule_tree_free(tree);
  5774. break;
  5775. case isl_schedule_node_domain:
  5776. - tree->domain = isl_union_set_align_params(tree->domain, space);
  5777. - if (!tree->domain)
  5778. + tree->anonunion.domain = isl_union_set_align_params(tree->anonunion.domain, space);
  5779. + if (!tree->anonunion.domain)
  5780. return isl_schedule_tree_free(tree);
  5781. break;
  5782. case isl_schedule_node_expansion:
  5783. - tree->contraction =
  5784. - isl_union_pw_multi_aff_align_params(tree->contraction,
  5785. + tree->anonunion.anonstruct.contraction =
  5786. + isl_union_pw_multi_aff_align_params(tree->anonunion.anonstruct.contraction,
  5787. isl_space_copy(space));
  5788. - tree->expansion = isl_union_map_align_params(tree->expansion,
  5789. + tree->anonunion.anonstruct.expansion = isl_union_map_align_params(tree->anonunion.anonstruct.expansion,
  5790. space);
  5791. - if (!tree->contraction || !tree->expansion)
  5792. + if (!tree->anonunion.anonstruct.contraction || !tree->anonunion.anonstruct.expansion)
  5793. return isl_schedule_tree_free(tree);
  5794. break;
  5795. case isl_schedule_node_extension:
  5796. - tree->extension = isl_union_map_align_params(tree->extension,
  5797. + tree->anonunion.extension = isl_union_map_align_params(tree->anonunion.extension,
  5798. space);
  5799. - if (!tree->extension)
  5800. + if (!tree->anonunion.extension)
  5801. return isl_schedule_tree_free(tree);
  5802. break;
  5803. case isl_schedule_node_filter:
  5804. - tree->filter = isl_union_set_align_params(tree->filter, space);
  5805. - if (!tree->filter)
  5806. + tree->anonunion.filter = isl_union_set_align_params(tree->anonunion.filter, space);
  5807. + if (!tree->anonunion.filter)
  5808. return isl_schedule_tree_free(tree);
  5809. break;
  5810. case isl_schedule_node_guard:
  5811. - tree->guard = isl_set_align_params(tree->guard, space);
  5812. - if (!tree->guard)
  5813. + tree->anonunion.guard = isl_set_align_params(tree->anonunion.guard, space);
  5814. + if (!tree->anonunion.guard)
  5815. return isl_schedule_tree_free(tree);
  5816. break;
  5817. case isl_schedule_node_leaf:
  5818. @@ -2552,30 +2552,30 @@
  5819. goto error;
  5820.  
  5821. if (tree->type == isl_schedule_node_band) {
  5822. - tree->band = isl_schedule_band_pullback_union_pw_multi_aff(
  5823. - tree->band, upma);
  5824. - if (!tree->band)
  5825. + tree->anonunion.band = isl_schedule_band_pullback_union_pw_multi_aff(
  5826. + tree->anonunion.band, upma);
  5827. + if (!tree->anonunion.band)
  5828. return isl_schedule_tree_free(tree);
  5829. } else if (tree->type == isl_schedule_node_domain) {
  5830. - tree->domain =
  5831. - isl_union_set_preimage_union_pw_multi_aff(tree->domain,
  5832. + tree->anonunion.domain =
  5833. + isl_union_set_preimage_union_pw_multi_aff(tree->anonunion.domain,
  5834. upma);
  5835. - if (!tree->domain)
  5836. + if (!tree->anonunion.domain)
  5837. return isl_schedule_tree_free(tree);
  5838. } else if (tree->type == isl_schedule_node_expansion) {
  5839. isl_die(isl_schedule_tree_get_ctx(tree), isl_error_unsupported,
  5840. "cannot pullback expansion node", goto error);
  5841. } else if (tree->type == isl_schedule_node_extension) {
  5842. - tree->extension =
  5843. + tree->anonunion.extension =
  5844. isl_union_map_preimage_range_union_pw_multi_aff(
  5845. - tree->extension, upma);
  5846. - if (!tree->extension)
  5847. + tree->anonunion.extension, upma);
  5848. + if (!tree->anonunion.extension)
  5849. return isl_schedule_tree_free(tree);
  5850. } else if (tree->type == isl_schedule_node_filter) {
  5851. - tree->filter =
  5852. - isl_union_set_preimage_union_pw_multi_aff(tree->filter,
  5853. + tree->anonunion.filter =
  5854. + isl_union_set_preimage_union_pw_multi_aff(tree->anonunion.filter,
  5855. upma);
  5856. - if (!tree->filter)
  5857. + if (!tree->anonunion.filter)
  5858. return isl_schedule_tree_free(tree);
  5859. }
  5860.  
  5861. @@ -2600,8 +2600,8 @@
  5862. if (!tree)
  5863. goto error;
  5864.  
  5865. - tree->band = isl_schedule_band_gist(tree->band, context);
  5866. - if (!tree->band)
  5867. + tree->anonunion.band = isl_schedule_band_gist(tree->anonunion.band, context);
  5868. + if (!tree->anonunion.band)
  5869. return isl_schedule_tree_free(tree);
  5870. return tree;
  5871. error:
  5872. @@ -2729,59 +2729,59 @@
  5873. p = isl_printer_print_str(p, "context");
  5874. p = isl_printer_yaml_next(p);
  5875. p = isl_printer_print_str(p, "\"");
  5876. - p = isl_printer_print_set(p, tree->context);
  5877. + p = isl_printer_print_set(p, tree->anonunion.context);
  5878. p = isl_printer_print_str(p, "\"");
  5879. break;
  5880. case isl_schedule_node_domain:
  5881. p = isl_printer_print_str(p, "domain");
  5882. p = isl_printer_yaml_next(p);
  5883. p = isl_printer_print_str(p, "\"");
  5884. - p = isl_printer_print_union_set(p, tree->domain);
  5885. + p = isl_printer_print_union_set(p, tree->anonunion.domain);
  5886. p = isl_printer_print_str(p, "\"");
  5887. break;
  5888. case isl_schedule_node_expansion:
  5889. p = isl_printer_print_str(p, "contraction");
  5890. p = isl_printer_yaml_next(p);
  5891. p = isl_printer_print_str(p, "\"");
  5892. - p = isl_printer_print_union_pw_multi_aff(p, tree->contraction);
  5893. + p = isl_printer_print_union_pw_multi_aff(p, tree->anonunion.anonstruct.contraction);
  5894. p = isl_printer_print_str(p, "\"");
  5895. p = isl_printer_yaml_next(p);
  5896. p = isl_printer_print_str(p, "expansion");
  5897. p = isl_printer_yaml_next(p);
  5898. p = isl_printer_print_str(p, "\"");
  5899. - p = isl_printer_print_union_map(p, tree->expansion);
  5900. + p = isl_printer_print_union_map(p, tree->anonunion.anonstruct.expansion);
  5901. p = isl_printer_print_str(p, "\"");
  5902. break;
  5903. case isl_schedule_node_extension:
  5904. p = isl_printer_print_str(p, "extension");
  5905. p = isl_printer_yaml_next(p);
  5906. p = isl_printer_print_str(p, "\"");
  5907. - p = isl_printer_print_union_map(p, tree->extension);
  5908. + p = isl_printer_print_union_map(p, tree->anonunion.extension);
  5909. p = isl_printer_print_str(p, "\"");
  5910. break;
  5911. case isl_schedule_node_filter:
  5912. p = isl_printer_print_str(p, "filter");
  5913. p = isl_printer_yaml_next(p);
  5914. p = isl_printer_print_str(p, "\"");
  5915. - p = isl_printer_print_union_set(p, tree->filter);
  5916. + p = isl_printer_print_union_set(p, tree->anonunion.filter);
  5917. p = isl_printer_print_str(p, "\"");
  5918. break;
  5919. case isl_schedule_node_guard:
  5920. p = isl_printer_print_str(p, "guard");
  5921. p = isl_printer_yaml_next(p);
  5922. p = isl_printer_print_str(p, "\"");
  5923. - p = isl_printer_print_set(p, tree->guard);
  5924. + p = isl_printer_print_set(p, tree->anonunion.guard);
  5925. p = isl_printer_print_str(p, "\"");
  5926. break;
  5927. case isl_schedule_node_mark:
  5928. p = isl_printer_print_str(p, "mark");
  5929. p = isl_printer_yaml_next(p);
  5930. p = isl_printer_print_str(p, "\"");
  5931. - p = isl_printer_print_str(p, isl_id_get_name(tree->mark));
  5932. + p = isl_printer_print_str(p, isl_id_get_name(tree->anonunion.mark));
  5933. p = isl_printer_print_str(p, "\"");
  5934. break;
  5935. case isl_schedule_node_band:
  5936. - p = print_tree_band(p, tree->band);
  5937. + p = print_tree_band(p, tree->anonunion.band);
  5938. break;
  5939. }
  5940. p = isl_printer_yaml_next(p);
  5941. diff -Naur gcc-9.5.0/isl-0.18/isl_schedule_tree.c.rej gcc-9.5.0-irix/isl-0.18/isl_schedule_tree.c.rej
  5942. --- gcc-9.5.0/isl-0.18/isl_schedule_tree.c.rej 1969-12-31 19:00:00.000000000 +0000
  5943. +++ gcc-9.5.0-irix/isl-0.18/isl_schedule_tree.c.rej 2024-12-22 11:54:25.583176000 +0000
  5944. @@ -0,0 +1,855 @@
  5945. +--- isl_schedule_tree.c 2016-12-15 11:27:30.000000000 +0000
  5946. ++++ isl_schedule_tree.c 2019-05-30 19:16:57.970849120 +0000
  5947. +@@ -84,45 +84,45 @@
  5948. + "allocation should have failed",
  5949. + isl_schedule_tree_free(dup));
  5950. + case isl_schedule_node_band:
  5951. +- dup->band = isl_schedule_band_copy(tree->band);
  5952. +- if (!dup->band)
  5953. ++ dup->anonunion.band = isl_schedule_band_copy(tree->anonunion.band);
  5954. ++ if (!dup->anonunion.band)
  5955. + return isl_schedule_tree_free(dup);
  5956. + break;
  5957. + case isl_schedule_node_context:
  5958. +- dup->context = isl_set_copy(tree->context);
  5959. +- if (!dup->context)
  5960. ++ dup->anonunion.context = isl_set_copy(tree->anonunion.context);
  5961. ++ if (!dup->anonunion.context)
  5962. + return isl_schedule_tree_free(dup);
  5963. + break;
  5964. + case isl_schedule_node_domain:
  5965. +- dup->domain = isl_union_set_copy(tree->domain);
  5966. +- if (!dup->domain)
  5967. ++ dup->anonunion.domain = isl_union_set_copy(tree->anonunion.domain);
  5968. ++ if (!dup->anonunion.domain)
  5969. + return isl_schedule_tree_free(dup);
  5970. + break;
  5971. + case isl_schedule_node_expansion:
  5972. +- dup->contraction =
  5973. +- isl_union_pw_multi_aff_copy(tree->contraction);
  5974. +- dup->expansion = isl_union_map_copy(tree->expansion);
  5975. +- if (!dup->contraction || !dup->expansion)
  5976. ++ dup->anonunion.anonstruct.contraction =
  5977. ++ isl_union_pw_multi_aff_copy(tree->anonunion.anonstruct.contraction);
  5978. ++ dup->anonunion.anonstruct.expansion = isl_union_map_copy(tree->anonunion.anonstruct.expansion);
  5979. ++ if (!dup->anonunion.anonstruct.contraction || !dup->anonunion.anonstruct.expansion)
  5980. + return isl_schedule_tree_free(dup);
  5981. + break;
  5982. + case isl_schedule_node_extension:
  5983. +- dup->extension = isl_union_map_copy(tree->extension);
  5984. +- if (!dup->extension)
  5985. ++ dup->anonunion.extension = isl_union_map_copy(tree->anonunion.extension);
  5986. ++ if (!dup->anonunion.extension)
  5987. + return isl_schedule_tree_free(dup);
  5988. + break;
  5989. + case isl_schedule_node_filter:
  5990. +- dup->filter = isl_union_set_copy(tree->filter);
  5991. +- if (!dup->filter)
  5992. ++ dup->anonunion.filter = isl_union_set_copy(tree->anonunion.filter);
  5993. ++ if (!dup->anonunion.filter)
  5994. + return isl_schedule_tree_free(dup);
  5995. + break;
  5996. + case isl_schedule_node_guard:
  5997. +- dup->guard = isl_set_copy(tree->guard);
  5998. +- if (!dup->guard)
  5999. ++ dup->anonunion.guard = isl_set_copy(tree->anonunion.guard);
  6000. ++ if (!dup->anonunion.guard)
  6001. + return isl_schedule_tree_free(dup);
  6002. + break;
  6003. + case isl_schedule_node_mark:
  6004. +- dup->mark = isl_id_copy(tree->mark);
  6005. +- if (!dup->mark)
  6006. ++ dup->anonunion.mark = isl_id_copy(tree->anonunion.mark);
  6007. ++ if (!dup->anonunion.mark)
  6008. + return isl_schedule_tree_free(dup);
  6009. + break;
  6010. + case isl_schedule_node_leaf:
  6011. +@@ -180,29 +180,29 @@
  6012. +
  6013. + switch (tree->type) {
  6014. + case isl_schedule_node_band:
  6015. +- isl_schedule_band_free(tree->band);
  6016. ++ isl_schedule_band_free(tree->anonunion.band);
  6017. + break;
  6018. + case isl_schedule_node_context:
  6019. +- isl_set_free(tree->context);
  6020. ++ isl_set_free(tree->anonunion.context);
  6021. + break;
  6022. + case isl_schedule_node_domain:
  6023. +- isl_union_set_free(tree->domain);
  6024. ++ isl_union_set_free(tree->anonunion.domain);
  6025. + break;
  6026. + case isl_schedule_node_expansion:
  6027. +- isl_union_pw_multi_aff_free(tree->contraction);
  6028. +- isl_union_map_free(tree->expansion);
  6029. ++ isl_union_pw_multi_aff_free(tree->anonunion.anonstruct.contraction);
  6030. ++ isl_union_map_free(tree->anonunion.anonstruct.expansion);
  6031. + break;
  6032. + case isl_schedule_node_extension:
  6033. +- isl_union_map_free(tree->extension);
  6034. ++ isl_union_map_free(tree->anonunion.extension);
  6035. + break;
  6036. + case isl_schedule_node_filter:
  6037. +- isl_union_set_free(tree->filter);
  6038. ++ isl_union_set_free(tree->anonunion.filter);
  6039. + break;
  6040. + case isl_schedule_node_guard:
  6041. +- isl_set_free(tree->guard);
  6042. ++ isl_set_free(tree->anonunion.guard);
  6043. + break;
  6044. + case isl_schedule_node_mark:
  6045. +- isl_id_free(tree->mark);
  6046. ++ isl_id_free(tree->anonunion.mark);
  6047. + break;
  6048. + case isl_schedule_node_sequence:
  6049. + case isl_schedule_node_set:
  6050. +@@ -241,7 +241,7 @@
  6051. + if (!tree)
  6052. + goto error;
  6053. +
  6054. +- tree->band = band;
  6055. ++ tree->anonunion.band = band;
  6056. + tree->anchored = isl_schedule_band_is_anchored(band);
  6057. +
  6058. + return tree;
  6059. +@@ -268,7 +268,7 @@
  6060. + if (!tree)
  6061. + goto error;
  6062. +
  6063. +- tree->context = context;
  6064. ++ tree->anonunion.context = context;
  6065. + tree->anchored = 1;
  6066. +
  6067. + return tree;
  6068. +@@ -293,7 +293,7 @@
  6069. + if (!tree)
  6070. + goto error;
  6071. +
  6072. +- tree->domain = domain;
  6073. ++ tree->anonunion.domain = domain;
  6074. +
  6075. + return tree;
  6076. + error:
  6077. +@@ -319,8 +319,8 @@
  6078. + if (!tree)
  6079. + goto error;
  6080. +
  6081. +- tree->contraction = contraction;
  6082. +- tree->expansion = expansion;
  6083. ++ tree->anonunion.anonstruct.contraction = contraction;
  6084. ++ tree->anonunion.anonstruct.expansion = expansion;
  6085. +
  6086. + return tree;
  6087. + error:
  6088. +@@ -348,7 +348,7 @@
  6089. + if (!tree)
  6090. + goto error;
  6091. +
  6092. +- tree->extension = extension;
  6093. ++ tree->anonunion.extension = extension;
  6094. + tree->anchored = 1;
  6095. +
  6096. + return tree;
  6097. +@@ -373,7 +373,7 @@
  6098. + if (!tree)
  6099. + goto error;
  6100. +
  6101. +- tree->filter = filter;
  6102. ++ tree->anonunion.filter = filter;
  6103. +
  6104. + return tree;
  6105. + error:
  6106. +@@ -399,7 +399,7 @@
  6107. + if (!tree)
  6108. + goto error;
  6109. +
  6110. +- tree->guard = guard;
  6111. ++ tree->anonunion.guard = guard;
  6112. + tree->anchored = 1;
  6113. +
  6114. + return tree;
  6115. +@@ -425,7 +425,7 @@
  6116. + if (!tree)
  6117. + goto error;
  6118. +
  6119. +- tree->mark = mark;
  6120. ++ tree->anonunion.mark = mark;
  6121. +
  6122. + return tree;
  6123. + error:
  6124. +@@ -456,7 +456,7 @@
  6125. + case isl_schedule_node_error:
  6126. + return -1;
  6127. + case isl_schedule_node_band:
  6128. +- return isl_schedule_band_is_anchored(tree->band);
  6129. ++ return isl_schedule_band_is_anchored(tree->anonunion.band);
  6130. + case isl_schedule_node_context:
  6131. + case isl_schedule_node_extension:
  6132. + case isl_schedule_node_guard:
  6133. +@@ -639,34 +639,34 @@
  6134. +
  6135. + switch (tree1->type) {
  6136. + case isl_schedule_node_band:
  6137. +- equal = isl_schedule_band_plain_is_equal(tree1->band,
  6138. +- tree2->band);
  6139. ++ equal = isl_schedule_band_plain_is_equal(tree1->anonunion.band,
  6140. ++ tree2->anonunion.band);
  6141. + break;
  6142. + case isl_schedule_node_context:
  6143. +- equal = isl_set_is_equal(tree1->context, tree2->context);
  6144. ++ equal = isl_set_is_equal(tree1->anonunion.context, tree2->anonunion.context);
  6145. + break;
  6146. + case isl_schedule_node_domain:
  6147. +- equal = isl_union_set_is_equal(tree1->domain, tree2->domain);
  6148. ++ equal = isl_union_set_is_equal(tree1->anonunion.domain, tree2->anonunion.domain);
  6149. + break;
  6150. + case isl_schedule_node_expansion:
  6151. +- equal = isl_union_map_is_equal(tree1->expansion,
  6152. +- tree2->expansion);
  6153. ++ equal = isl_union_map_is_equal(tree1->anonunion.anonstruct.expansion,
  6154. ++ tree2->anonunion.anonstruct.expansion);
  6155. + if (equal >= 0 && equal)
  6156. + equal = isl_union_pw_multi_aff_plain_is_equal(
  6157. +- tree1->contraction, tree2->contraction);
  6158. ++ tree1->anonunion.anonstruct.contraction, tree2->anonunion.anonstruct.contraction);
  6159. + break;
  6160. + case isl_schedule_node_extension:
  6161. +- equal = isl_union_map_is_equal(tree1->extension,
  6162. +- tree2->extension);
  6163. ++ equal = isl_union_map_is_equal(tree1->anonunion.extension,
  6164. ++ tree2->anonunion.extension);
  6165. + break;
  6166. + case isl_schedule_node_filter:
  6167. +- equal = isl_union_set_is_equal(tree1->filter, tree2->filter);
  6168. ++ equal = isl_union_set_is_equal(tree1->anonunion.filter, tree2->anonunion.filter);
  6169. + break;
  6170. + case isl_schedule_node_guard:
  6171. +- equal = isl_set_is_equal(tree1->guard, tree2->guard);
  6172. ++ equal = isl_set_is_equal(tree1->anonunion.guard, tree2->anonunion.guard);
  6173. + break;
  6174. + case isl_schedule_node_mark:
  6175. +- equal = tree1->mark == tree2->mark;
  6176. ++ equal = tree1->anonunion.mark == tree2->anonunion.mark;
  6177. + break;
  6178. + case isl_schedule_node_leaf:
  6179. + case isl_schedule_node_sequence:
  6180. +@@ -1002,7 +1002,7 @@
  6181. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  6182. + "not a band node", return 0);
  6183. +
  6184. +- return isl_schedule_band_n_member(tree->band);
  6185. ++ return isl_schedule_band_n_member(tree->anonunion.band);
  6186. + }
  6187. +
  6188. + /* Is the band member at position "pos" of the band tree root
  6189. +@@ -1018,7 +1018,7 @@
  6190. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  6191. + "not a band node", return isl_bool_error);
  6192. +
  6193. +- return isl_schedule_band_member_get_coincident(tree->band, pos);
  6194. ++ return isl_schedule_band_member_get_coincident(tree->anonunion.band, pos);
  6195. + }
  6196. +
  6197. + /* Mark the given band member as being coincident or not
  6198. +@@ -1039,9 +1039,9 @@
  6199. + if (!tree)
  6200. + return NULL;
  6201. +
  6202. +- tree->band = isl_schedule_band_member_set_coincident(tree->band, pos,
  6203. ++ tree->anonunion.band = isl_schedule_band_member_set_coincident(tree->anonunion.band, pos,
  6204. + coincident);
  6205. +- if (!tree->band)
  6206. ++ if (!tree->anonunion.band)
  6207. + return isl_schedule_tree_free(tree);
  6208. + return tree;
  6209. + }
  6210. +@@ -1058,7 +1058,7 @@
  6211. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  6212. + "not a band node", return isl_bool_error);
  6213. +
  6214. +- return isl_schedule_band_get_permutable(tree->band);
  6215. ++ return isl_schedule_band_get_permutable(tree->anonunion.band);
  6216. + }
  6217. +
  6218. + /* Mark the band tree root permutable or not according to "permutable"?
  6219. +@@ -1077,8 +1077,8 @@
  6220. + if (!tree)
  6221. + return NULL;
  6222. +
  6223. +- tree->band = isl_schedule_band_set_permutable(tree->band, permutable);
  6224. +- if (!tree->band)
  6225. ++ tree->anonunion.band = isl_schedule_band_set_permutable(tree->anonunion.band, permutable);
  6226. ++ if (!tree->anonunion.band)
  6227. + return isl_schedule_tree_free(tree);
  6228. + return tree;
  6229. + }
  6230. +@@ -1095,7 +1095,7 @@
  6231. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  6232. + "not a band node", return NULL);
  6233. +
  6234. +- return isl_schedule_band_get_space(tree->band);
  6235. ++ return isl_schedule_band_get_space(tree->anonunion.band);
  6236. + }
  6237. +
  6238. + /* Intersect the domain of the band schedule of the band tree root
  6239. +@@ -1111,8 +1111,8 @@
  6240. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  6241. + "not a band node", goto error);
  6242. +
  6243. +- tree->band = isl_schedule_band_intersect_domain(tree->band, domain);
  6244. +- if (!tree->band)
  6245. ++ tree->anonunion.band = isl_schedule_band_intersect_domain(tree->anonunion.band, domain);
  6246. ++ if (!tree->anonunion.band)
  6247. + return isl_schedule_tree_free(tree);
  6248. +
  6249. + return tree;
  6250. +@@ -1134,7 +1134,7 @@
  6251. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  6252. + "not a band node", return NULL);
  6253. +
  6254. +- return isl_schedule_band_get_partial_schedule(tree->band);
  6255. ++ return isl_schedule_band_get_partial_schedule(tree->anonunion.band);
  6256. + }
  6257. +
  6258. + /* Replace the schedule of the band tree root by "schedule".
  6259. +@@ -1150,7 +1150,7 @@
  6260. + if (tree->type != isl_schedule_node_band)
  6261. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  6262. + "not a band node", return NULL);
  6263. +- tree->band = isl_schedule_band_set_partial_schedule(tree->band,
  6264. ++ tree->anonunion.band = isl_schedule_band_set_partial_schedule(tree->anonunion.band,
  6265. + schedule);
  6266. +
  6267. + return tree;
  6268. +@@ -1173,7 +1173,7 @@
  6269. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  6270. + "not a band node", return isl_ast_loop_error);
  6271. +
  6272. +- return isl_schedule_band_member_get_ast_loop_type(tree->band, pos);
  6273. ++ return isl_schedule_band_member_get_ast_loop_type(tree->anonunion.band, pos);
  6274. + }
  6275. +
  6276. + /* Set the loop AST generation type for the band member of the band tree root
  6277. +@@ -1191,9 +1191,9 @@
  6278. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  6279. + "not a band node", return isl_schedule_tree_free(tree));
  6280. +
  6281. +- tree->band = isl_schedule_band_member_set_ast_loop_type(tree->band,
  6282. ++ tree->anonunion.band = isl_schedule_band_member_set_ast_loop_type(tree->anonunion.band,
  6283. + pos, type);
  6284. +- if (!tree->band)
  6285. ++ if (!tree->anonunion.band)
  6286. + return isl_schedule_tree_free(tree);
  6287. +
  6288. + return tree;
  6289. +@@ -1212,7 +1212,7 @@
  6290. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  6291. + "not a band node", return isl_ast_loop_error);
  6292. +
  6293. +- return isl_schedule_band_member_get_isolate_ast_loop_type(tree->band,
  6294. ++ return isl_schedule_band_member_get_isolate_ast_loop_type(tree->anonunion.band,
  6295. + pos);
  6296. + }
  6297. +
  6298. +@@ -1232,9 +1232,9 @@
  6299. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  6300. + "not a band node", return isl_schedule_tree_free(tree));
  6301. +
  6302. +- tree->band = isl_schedule_band_member_set_isolate_ast_loop_type(
  6303. +- tree->band, pos, type);
  6304. +- if (!tree->band)
  6305. ++ tree->anonunion.band = isl_schedule_band_member_set_isolate_ast_loop_type(
  6306. ++ tree->anonunion.band, pos, type);
  6307. ++ if (!tree->anonunion.band)
  6308. + return isl_schedule_tree_free(tree);
  6309. +
  6310. + return tree;
  6311. +@@ -1252,7 +1252,7 @@
  6312. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  6313. + "not a band node", return NULL);
  6314. +
  6315. +- return isl_schedule_band_get_ast_build_options(tree->band);
  6316. ++ return isl_schedule_band_get_ast_build_options(tree->anonunion.band);
  6317. + }
  6318. +
  6319. + /* Replace the AST build options associated to band tree root by "options".
  6320. +@@ -1273,9 +1273,9 @@
  6321. + "not a band node", goto error);
  6322. +
  6323. + was_anchored = isl_schedule_tree_is_anchored(tree);
  6324. +- tree->band = isl_schedule_band_set_ast_build_options(tree->band,
  6325. ++ tree->anonunion.band = isl_schedule_band_set_ast_build_options(tree->anonunion.band,
  6326. + options);
  6327. +- if (!tree->band)
  6328. ++ if (!tree->anonunion.band)
  6329. + return isl_schedule_tree_free(tree);
  6330. + if (isl_schedule_tree_is_anchored(tree) != was_anchored)
  6331. + tree = isl_schedule_tree_update_anchored(tree);
  6332. +@@ -1300,7 +1300,7 @@
  6333. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  6334. + "not a band node", return NULL);
  6335. +
  6336. +- return isl_schedule_band_get_ast_isolate_option(tree->band, depth);
  6337. ++ return isl_schedule_band_get_ast_isolate_option(tree->anonunion.band, depth);
  6338. + }
  6339. +
  6340. + /* Return the context of the context tree root.
  6341. +@@ -1315,7 +1315,7 @@
  6342. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  6343. + "not a context node", return NULL);
  6344. +
  6345. +- return isl_set_copy(tree->context);
  6346. ++ return isl_set_copy(tree->anonunion.context);
  6347. + }
  6348. +
  6349. + /* Return the domain of the domain tree root.
  6350. +@@ -1330,7 +1330,7 @@
  6351. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  6352. + "not a domain node", return NULL);
  6353. +
  6354. +- return isl_union_set_copy(tree->domain);
  6355. ++ return isl_union_set_copy(tree->anonunion.domain);
  6356. + }
  6357. +
  6358. + /* Replace the domain of domain tree root "tree" by "domain".
  6359. +@@ -1346,8 +1346,8 @@
  6360. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  6361. + "not a domain node", goto error);
  6362. +
  6363. +- isl_union_set_free(tree->domain);
  6364. +- tree->domain = domain;
  6365. ++ isl_union_set_free(tree->anonunion.domain);
  6366. ++ tree->anonunion.domain = domain;
  6367. +
  6368. + return tree;
  6369. + error:
  6370. +@@ -1368,7 +1368,7 @@
  6371. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  6372. + "not an expansion node", return NULL);
  6373. +
  6374. +- return isl_union_pw_multi_aff_copy(tree->contraction);
  6375. ++ return isl_union_pw_multi_aff_copy(tree->anonunion.anonstruct.contraction);
  6376. + }
  6377. +
  6378. + /* Return the expansion of the expansion tree root.
  6379. +@@ -1383,7 +1383,7 @@
  6380. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  6381. + "not an expansion node", return NULL);
  6382. +
  6383. +- return isl_union_map_copy(tree->expansion);
  6384. ++ return isl_union_map_copy(tree->anonunion.anonstruct.expansion);
  6385. + }
  6386. +
  6387. + /* Replace the contraction and the expansion of the expansion tree root "tree"
  6388. +@@ -1403,10 +1403,10 @@
  6389. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  6390. + "not an expansion node", return NULL);
  6391. +
  6392. +- isl_union_pw_multi_aff_free(tree->contraction);
  6393. +- tree->contraction = contraction;
  6394. +- isl_union_map_free(tree->expansion);
  6395. +- tree->expansion = expansion;
  6396. ++ isl_union_pw_multi_aff_free(tree->anonunion.anonstruct.contraction);
  6397. ++ tree->anonunion.anonstruct.contraction = contraction;
  6398. ++ isl_union_map_free(tree->anonunion.anonstruct.expansion);
  6399. ++ tree->anonunion.anonstruct.expansion = expansion;
  6400. +
  6401. + return tree;
  6402. + error:
  6403. +@@ -1428,7 +1428,7 @@
  6404. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  6405. + "not an extension node", return NULL);
  6406. +
  6407. +- return isl_union_map_copy(tree->extension);
  6408. ++ return isl_union_map_copy(tree->anonunion.extension);
  6409. + }
  6410. +
  6411. + /* Replace the extension of extension tree root "tree" by "extension".
  6412. +@@ -1443,8 +1443,8 @@
  6413. + if (tree->type != isl_schedule_node_extension)
  6414. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  6415. + "not an extension node", return NULL);
  6416. +- isl_union_map_free(tree->extension);
  6417. +- tree->extension = extension;
  6418. ++ isl_union_map_free(tree->anonunion.extension);
  6419. ++ tree->anonunion.extension = extension;
  6420. +
  6421. + return tree;
  6422. + error:
  6423. +@@ -1465,7 +1465,7 @@
  6424. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  6425. + "not a filter node", return NULL);
  6426. +
  6427. +- return isl_union_set_copy(tree->filter);
  6428. ++ return isl_union_set_copy(tree->anonunion.filter);
  6429. + }
  6430. +
  6431. + /* Replace the filter of the filter tree root by "filter".
  6432. +@@ -1481,8 +1481,8 @@
  6433. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  6434. + "not a filter node", return NULL);
  6435. +
  6436. +- isl_union_set_free(tree->filter);
  6437. +- tree->filter = filter;
  6438. ++ isl_union_set_free(tree->anonunion.filter);
  6439. ++ tree->anonunion.filter = filter;
  6440. +
  6441. + return tree;
  6442. + error:
  6443. +@@ -1503,7 +1503,7 @@
  6444. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  6445. + "not a guard node", return NULL);
  6446. +
  6447. +- return isl_set_copy(tree->guard);
  6448. ++ return isl_set_copy(tree->anonunion.guard);
  6449. + }
  6450. +
  6451. + /* Return the mark identifier of the mark tree root "tree".
  6452. +@@ -1518,7 +1518,7 @@
  6453. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  6454. + "not a mark node", return NULL);
  6455. +
  6456. +- return isl_id_copy(tree->mark);
  6457. ++ return isl_id_copy(tree->anonunion.mark);
  6458. + }
  6459. +
  6460. + /* Set dim to the range dimension of "map" and abort the search.
  6461. +@@ -1828,7 +1828,7 @@
  6462. + case isl_schedule_node_band:
  6463. + if (isl_schedule_tree_band_n_member(tree) == 0)
  6464. + return subtree_schedule_extend_child(tree, outer);
  6465. +- mupa = isl_schedule_band_get_partial_schedule(tree->band);
  6466. ++ mupa = isl_schedule_band_get_partial_schedule(tree->anonunion.band);
  6467. + umap = isl_union_map_from_multi_union_pw_aff(mupa);
  6468. + outer = isl_union_map_flat_range_product(outer, umap);
  6469. + umap = subtree_schedule_extend_child(tree, outer);
  6470. +@@ -1940,7 +1940,7 @@
  6471. + isl_error_internal,
  6472. + "0D band should be handled by caller",
  6473. + return NULL);
  6474. +- mupa = isl_schedule_band_get_partial_schedule(tree->band);
  6475. ++ mupa = isl_schedule_band_get_partial_schedule(tree->anonunion.band);
  6476. + domain = isl_multi_union_pw_aff_domain(mupa);
  6477. + domain = isl_union_set_universe(domain);
  6478. + break;
  6479. +@@ -2008,8 +2008,8 @@
  6480. + if (!tree)
  6481. + goto error;
  6482. +
  6483. +- tree->band = isl_schedule_band_scale(tree->band, mv);
  6484. +- if (!tree->band)
  6485. ++ tree->anonunion.band = isl_schedule_band_scale(tree->anonunion.band, mv);
  6486. ++ if (!tree->anonunion.band)
  6487. + return isl_schedule_tree_free(tree);
  6488. +
  6489. + return tree;
  6490. +@@ -2035,8 +2035,8 @@
  6491. + if (!tree)
  6492. + goto error;
  6493. +
  6494. +- tree->band = isl_schedule_band_scale_down(tree->band, mv);
  6495. +- if (!tree->band)
  6496. ++ tree->anonunion.band = isl_schedule_band_scale_down(tree->anonunion.band, mv);
  6497. ++ if (!tree->anonunion.band)
  6498. + return isl_schedule_tree_free(tree);
  6499. +
  6500. + return tree;
  6501. +@@ -2062,8 +2062,8 @@
  6502. + if (!tree)
  6503. + goto error;
  6504. +
  6505. +- tree->band = isl_schedule_band_mod(tree->band, mv);
  6506. +- if (!tree->band)
  6507. ++ tree->anonunion.band = isl_schedule_band_mod(tree->anonunion.band, mv);
  6508. ++ if (!tree->anonunion.band)
  6509. + return isl_schedule_tree_free(tree);
  6510. +
  6511. + return tree;
  6512. +@@ -2089,8 +2089,8 @@
  6513. + if (!tree)
  6514. + goto error;
  6515. +
  6516. +- tree->band = isl_schedule_band_shift(tree->band, shift);
  6517. +- if (!tree->band)
  6518. ++ tree->anonunion.band = isl_schedule_band_shift(tree->anonunion.band, shift);
  6519. ++ if (!tree->anonunion.band)
  6520. + return isl_schedule_tree_free(tree);
  6521. +
  6522. + return tree;
  6523. +@@ -2165,12 +2165,12 @@
  6524. + if (!tree || !child)
  6525. + goto error;
  6526. +
  6527. +- tree->band = isl_schedule_band_tile(tree->band,
  6528. ++ tree->anonunion.band = isl_schedule_band_tile(tree->anonunion.band,
  6529. + isl_multi_val_copy(sizes));
  6530. +- if (!tree->band)
  6531. ++ if (!tree->anonunion.band)
  6532. + goto error;
  6533. +- child->band = isl_schedule_band_point(child->band, tree->band, sizes);
  6534. +- if (!child->band)
  6535. ++ child->anonunion.band = isl_schedule_band_point(child->anonunion.band, tree->anonunion.band, sizes);
  6536. ++ if (!child->anonunion.band)
  6537. + child = isl_schedule_tree_free(child);
  6538. +
  6539. + tree = isl_schedule_tree_replace_child(tree, 0, child);
  6540. +@@ -2295,14 +2295,14 @@
  6541. + isolate = isl_schedule_tree_band_get_ast_isolate_option(tree, depth);
  6542. + tree_isolate = isolate_initial(isolate, pos, n - pos);
  6543. + child_isolate = isolate_final(isolate, pos, n - pos);
  6544. +- child->band = isl_schedule_band_drop(child->band, 0, pos);
  6545. +- child->band = isl_schedule_band_replace_ast_build_option(child->band,
  6546. ++ child->anonunion.band = isl_schedule_band_drop(child->anonunion.band, 0, pos);
  6547. ++ child->anonunion.band = isl_schedule_band_replace_ast_build_option(child->anonunion.band,
  6548. + isl_set_copy(isolate), child_isolate);
  6549. +- tree->band = isl_schedule_band_drop(tree->band, pos, n - pos);
  6550. +- tree->band = isl_schedule_band_replace_ast_build_option(tree->band,
  6551. ++ tree->anonunion.band = isl_schedule_band_drop(tree->anonunion.band, pos, n - pos);
  6552. ++ tree->anonunion.band = isl_schedule_band_replace_ast_build_option(tree->anonunion.band,
  6553. + isl_set_copy(isolate), tree_isolate);
  6554. + isl_set_free(isolate);
  6555. +- if (!child->band || !tree->band)
  6556. ++ if (!child->anonunion.band || !tree->anonunion.band)
  6557. + goto error;
  6558. +
  6559. + tree = isl_schedule_tree_replace_child(tree, 0, child);
  6560. +@@ -2369,40 +2369,40 @@
  6561. + case isl_schedule_node_error:
  6562. + return isl_schedule_tree_free(tree);
  6563. + case isl_schedule_node_band:
  6564. +- tree->band = isl_schedule_band_reset_user(tree->band);
  6565. +- if (!tree->band)
  6566. ++ tree->anonunion.band = isl_schedule_band_reset_user(tree->anonunion.band);
  6567. ++ if (!tree->anonunion.band)
  6568. + return isl_schedule_tree_free(tree);
  6569. + break;
  6570. + case isl_schedule_node_context:
  6571. +- tree->context = isl_set_reset_user(tree->context);
  6572. +- if (!tree->context)
  6573. ++ tree->anonunion.context = isl_set_reset_user(tree->anonunion.context);
  6574. ++ if (!tree->anonunion.context)
  6575. + return isl_schedule_tree_free(tree);
  6576. + break;
  6577. + case isl_schedule_node_domain:
  6578. +- tree->domain = isl_union_set_reset_user(tree->domain);
  6579. +- if (!tree->domain)
  6580. ++ tree->anonunion.domain = isl_union_set_reset_user(tree->anonunion.domain);
  6581. ++ if (!tree->anonunion.domain)
  6582. + return isl_schedule_tree_free(tree);
  6583. + break;
  6584. + case isl_schedule_node_expansion:
  6585. +- tree->contraction =
  6586. +- isl_union_pw_multi_aff_reset_user(tree->contraction);
  6587. +- tree->expansion = isl_union_map_reset_user(tree->expansion);
  6588. +- if (!tree->contraction || !tree->expansion)
  6589. ++ tree->anonunion.anonstruct.contraction =
  6590. ++ isl_union_pw_multi_aff_reset_user(tree->anonunion.anonstruct.contraction);
  6591. ++ tree->anonunion.anonstruct.expansion = isl_union_map_reset_user(tree->anonunion.anonstruct.expansion);
  6592. ++ if (!tree->anonunion.anonstruct.contraction || !tree->anonunion.anonstruct.expansion)
  6593. + return isl_schedule_tree_free(tree);
  6594. + break;
  6595. + case isl_schedule_node_extension:
  6596. +- tree->extension = isl_union_map_reset_user(tree->extension);
  6597. +- if (!tree->extension)
  6598. ++ tree->anonunion.extension = isl_union_map_reset_user(tree->anonunion.extension);
  6599. ++ if (!tree->anonunion.extension)
  6600. + return isl_schedule_tree_free(tree);
  6601. + break;
  6602. + case isl_schedule_node_filter:
  6603. +- tree->filter = isl_union_set_reset_user(tree->filter);
  6604. +- if (!tree->filter)
  6605. ++ tree->anonunion.filter = isl_union_set_reset_user(tree->anonunion.filter);
  6606. ++ if (!tree->anonunion.filter)
  6607. + return isl_schedule_tree_free(tree);
  6608. + break;
  6609. + case isl_schedule_node_guard:
  6610. +- tree->guard = isl_set_reset_user(tree->guard);
  6611. +- if (!tree->guard)
  6612. ++ tree->anonunion.guard = isl_set_reset_user(tree->anonunion.guard);
  6613. ++ if (!tree->anonunion.guard)
  6614. + return isl_schedule_tree_free(tree);
  6615. + break;
  6616. + case isl_schedule_node_leaf:
  6617. +@@ -2436,43 +2436,43 @@
  6618. + case isl_schedule_node_error:
  6619. + goto error;
  6620. + case isl_schedule_node_band:
  6621. +- tree->band = isl_schedule_band_align_params(tree->band, space);
  6622. +- if (!tree->band)
  6623. ++ tree->anonunion.band = isl_schedule_band_align_params(tree->anonunion.band, space);
  6624. ++ if (!tree->anonunion.band)
  6625. + return isl_schedule_tree_free(tree);
  6626. + break;
  6627. + case isl_schedule_node_context:
  6628. +- tree->context = isl_set_align_params(tree->context, space);
  6629. +- if (!tree->context)
  6630. ++ tree->anonunion.context = isl_set_align_params(tree->anonunion.context, space);
  6631. ++ if (!tree->anonunion.context)
  6632. + return isl_schedule_tree_free(tree);
  6633. + break;
  6634. + case isl_schedule_node_domain:
  6635. +- tree->domain = isl_union_set_align_params(tree->domain, space);
  6636. +- if (!tree->domain)
  6637. ++ tree->anonunion.domain = isl_union_set_align_params(tree->anonunion.domain, space);
  6638. ++ if (!tree->anonunion.domain)
  6639. + return isl_schedule_tree_free(tree);
  6640. + break;
  6641. + case isl_schedule_node_expansion:
  6642. +- tree->contraction =
  6643. +- isl_union_pw_multi_aff_align_params(tree->contraction,
  6644. ++ tree->anonunion.anonstruct.contraction =
  6645. ++ isl_union_pw_multi_aff_align_params(tree->anonunion.anonstruct.contraction,
  6646. + isl_space_copy(space));
  6647. +- tree->expansion = isl_union_map_align_params(tree->expansion,
  6648. ++ tree->anonunion.anonstruct.expansion = isl_union_map_align_params(tree->anonunion.anonstruct.expansion,
  6649. + space);
  6650. +- if (!tree->contraction || !tree->expansion)
  6651. ++ if (!tree->anonunion.anonstruct.contraction || !tree->anonunion.anonstruct.expansion)
  6652. + return isl_schedule_tree_free(tree);
  6653. + break;
  6654. + case isl_schedule_node_extension:
  6655. +- tree->extension = isl_union_map_align_params(tree->extension,
  6656. ++ tree->anonunion.extension = isl_union_map_align_params(tree->anonunion.extension,
  6657. + space);
  6658. +- if (!tree->extension)
  6659. ++ if (!tree->anonunion.extension)
  6660. + return isl_schedule_tree_free(tree);
  6661. + break;
  6662. + case isl_schedule_node_filter:
  6663. +- tree->filter = isl_union_set_align_params(tree->filter, space);
  6664. +- if (!tree->filter)
  6665. ++ tree->anonunion.filter = isl_union_set_align_params(tree->anonunion.filter, space);
  6666. ++ if (!tree->anonunion.filter)
  6667. + return isl_schedule_tree_free(tree);
  6668. + break;
  6669. + case isl_schedule_node_guard:
  6670. +- tree->guard = isl_set_align_params(tree->guard, space);
  6671. +- if (!tree->guard)
  6672. ++ tree->anonunion.guard = isl_set_align_params(tree->anonunion.guard, space);
  6673. ++ if (!tree->anonunion.guard)
  6674. + return isl_schedule_tree_free(tree);
  6675. + break;
  6676. + case isl_schedule_node_leaf:
  6677. +@@ -2552,30 +2552,30 @@
  6678. + goto error;
  6679. +
  6680. + if (tree->type == isl_schedule_node_band) {
  6681. +- tree->band = isl_schedule_band_pullback_union_pw_multi_aff(
  6682. +- tree->band, upma);
  6683. +- if (!tree->band)
  6684. ++ tree->anonunion.band = isl_schedule_band_pullback_union_pw_multi_aff(
  6685. ++ tree->anonunion.band, upma);
  6686. ++ if (!tree->anonunion.band)
  6687. + return isl_schedule_tree_free(tree);
  6688. + } else if (tree->type == isl_schedule_node_domain) {
  6689. +- tree->domain =
  6690. +- isl_union_set_preimage_union_pw_multi_aff(tree->domain,
  6691. ++ tree->anonunion.domain =
  6692. ++ isl_union_set_preimage_union_pw_multi_aff(tree->anonunion.domain,
  6693. + upma);
  6694. +- if (!tree->domain)
  6695. ++ if (!tree->anonunion.domain)
  6696. + return isl_schedule_tree_free(tree);
  6697. + } else if (tree->type == isl_schedule_node_expansion) {
  6698. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_unsupported,
  6699. + "cannot pullback expansion node", goto error);
  6700. + } else if (tree->type == isl_schedule_node_extension) {
  6701. +- tree->extension =
  6702. ++ tree->anonunion.extension =
  6703. + isl_union_map_preimage_range_union_pw_multi_aff(
  6704. +- tree->extension, upma);
  6705. +- if (!tree->extension)
  6706. ++ tree->anonunion.extension, upma);
  6707. ++ if (!tree->anonunion.extension)
  6708. + return isl_schedule_tree_free(tree);
  6709. + } else if (tree->type == isl_schedule_node_filter) {
  6710. +- tree->filter =
  6711. +- isl_union_set_preimage_union_pw_multi_aff(tree->filter,
  6712. ++ tree->anonunion.filter =
  6713. ++ isl_union_set_preimage_union_pw_multi_aff(tree->anonunion.filter,
  6714. + upma);
  6715. +- if (!tree->filter)
  6716. ++ if (!tree->anonunion.filter)
  6717. + return isl_schedule_tree_free(tree);
  6718. + }
  6719. +
  6720. +@@ -2600,8 +2600,8 @@
  6721. + if (!tree)
  6722. + goto error;
  6723. +
  6724. +- tree->band = isl_schedule_band_gist(tree->band, context);
  6725. +- if (!tree->band)
  6726. ++ tree->anonunion.band = isl_schedule_band_gist(tree->anonunion.band, context);
  6727. ++ if (!tree->anonunion.band)
  6728. + return isl_schedule_tree_free(tree);
  6729. + return tree;
  6730. + error:
  6731. +@@ -2729,59 +2729,59 @@
  6732. + p = isl_printer_print_str(p, "context");
  6733. + p = isl_printer_yaml_next(p);
  6734. + p = isl_printer_print_str(p, "\"");
  6735. +- p = isl_printer_print_set(p, tree->context);
  6736. ++ p = isl_printer_print_set(p, tree->anonunion.context);
  6737. + p = isl_printer_print_str(p, "\"");
  6738. + break;
  6739. + case isl_schedule_node_domain:
  6740. + p = isl_printer_print_str(p, "domain");
  6741. + p = isl_printer_yaml_next(p);
  6742. + p = isl_printer_print_str(p, "\"");
  6743. +- p = isl_printer_print_union_set(p, tree->domain);
  6744. ++ p = isl_printer_print_union_set(p, tree->anonunion.domain);
  6745. + p = isl_printer_print_str(p, "\"");
  6746. + break;
  6747. + case isl_schedule_node_expansion:
  6748. + p = isl_printer_print_str(p, "contraction");
  6749. + p = isl_printer_yaml_next(p);
  6750. + p = isl_printer_print_str(p, "\"");
  6751. +- p = isl_printer_print_union_pw_multi_aff(p, tree->contraction);
  6752. ++ p = isl_printer_print_union_pw_multi_aff(p, tree->anonunion.anonstruct.contraction);
  6753. + p = isl_printer_print_str(p, "\"");
  6754. + p = isl_printer_yaml_next(p);
  6755. + p = isl_printer_print_str(p, "expansion");
  6756. + p = isl_printer_yaml_next(p);
  6757. + p = isl_printer_print_str(p, "\"");
  6758. +- p = isl_printer_print_union_map(p, tree->expansion);
  6759. ++ p = isl_printer_print_union_map(p, tree->anonunion.anonstruct.expansion);
  6760. + p = isl_printer_print_str(p, "\"");
  6761. + break;
  6762. + case isl_schedule_node_extension:
  6763. + p = isl_printer_print_str(p, "extension");
  6764. + p = isl_printer_yaml_next(p);
  6765. + p = isl_printer_print_str(p, "\"");
  6766. +- p = isl_printer_print_union_map(p, tree->extension);
  6767. ++ p = isl_printer_print_union_map(p, tree->anonunion.extension);
  6768. + p = isl_printer_print_str(p, "\"");
  6769. + break;
  6770. + case isl_schedule_node_filter:
  6771. + p = isl_printer_print_str(p, "filter");
  6772. + p = isl_printer_yaml_next(p);
  6773. + p = isl_printer_print_str(p, "\"");
  6774. +- p = isl_printer_print_union_set(p, tree->filter);
  6775. ++ p = isl_printer_print_union_set(p, tree->anonunion.filter);
  6776. + p = isl_printer_print_str(p, "\"");
  6777. + break;
  6778. + case isl_schedule_node_guard:
  6779. + p = isl_printer_print_str(p, "guard");
  6780. + p = isl_printer_yaml_next(p);
  6781. + p = isl_printer_print_str(p, "\"");
  6782. +- p = isl_printer_print_set(p, tree->guard);
  6783. ++ p = isl_printer_print_set(p, tree->anonunion.guard);
  6784. + p = isl_printer_print_str(p, "\"");
  6785. + break;
  6786. + case isl_schedule_node_mark:
  6787. + p = isl_printer_print_str(p, "mark");
  6788. + p = isl_printer_yaml_next(p);
  6789. + p = isl_printer_print_str(p, "\"");
  6790. +- p = isl_printer_print_str(p, isl_id_get_name(tree->mark));
  6791. ++ p = isl_printer_print_str(p, isl_id_get_name(tree->anonunion.mark));
  6792. + p = isl_printer_print_str(p, "\"");
  6793. + break;
  6794. + case isl_schedule_node_band:
  6795. +- p = print_tree_band(p, tree->band);
  6796. ++ p = print_tree_band(p, tree->anonunion.band);
  6797. + break;
  6798. + }
  6799. + p = isl_printer_yaml_next(p);
  6800. diff -Naur gcc-9.5.0/isl-0.18/isl_schedule_tree.h gcc-9.5.0-irix/isl-0.18/isl_schedule_tree.h
  6801. --- gcc-9.5.0/isl-0.18/isl_schedule_tree.h 2016-12-12 04:15:44.000000000 +0000
  6802. +++ gcc-9.5.0-irix/isl-0.18/isl_schedule_tree.h 2024-12-22 11:54:48.327900000 +0000
  6803. @@ -63,12 +63,12 @@
  6804. struct {
  6805. isl_union_pw_multi_aff *contraction;
  6806. isl_union_map *expansion;
  6807. - };
  6808. + } anonstruct;
  6809. isl_union_map *extension;
  6810. isl_union_set *filter;
  6811. isl_set *guard;
  6812. isl_id *mark;
  6813. - };
  6814. + } anonunion;
  6815. isl_schedule_tree_list *children;
  6816. };
  6817.  
  6818. diff -Naur gcc-9.5.0/isl-0.18/isl_schedule_tree.h.rej gcc-9.5.0-irix/isl-0.18/isl_schedule_tree.h.rej
  6819. --- gcc-9.5.0/isl-0.18/isl_schedule_tree.h.rej 1969-12-31 19:00:00.000000000 +0000
  6820. +++ gcc-9.5.0-irix/isl-0.18/isl_schedule_tree.h.rej 2024-12-22 11:54:26.488072000 +0000
  6821. @@ -0,0 +1,17 @@
  6822. +--- isl_schedule_tree.h 2016-12-12 09:15:44.000000000 +0000
  6823. ++++ isl_schedule_tree.h 2019-05-30 19:16:57.974657440 +0000
  6824. +@@ -63,12 +63,12 @@
  6825. + struct {
  6826. + isl_union_pw_multi_aff *contraction;
  6827. + isl_union_map *expansion;
  6828. +- };
  6829. ++ } anonstruct;
  6830. + isl_union_map *extension;
  6831. + isl_union_set *filter;
  6832. + isl_set *guard;
  6833. + isl_id *mark;
  6834. +- };
  6835. ++ } anonunion;
  6836. + isl_schedule_tree_list *children;
  6837. + };
  6838. +
  6839. diff -Naur gcc-9.5.0/isl-0.18/isl_test.c gcc-9.5.0-irix/isl-0.18/isl_test.c
  6840. --- gcc-9.5.0/isl-0.18/isl_test.c 2016-12-15 06:27:30.000000000 +0000
  6841. +++ gcc-9.5.0-irix/isl-0.18/isl_test.c 2024-12-22 11:54:48.335515200 +0000
  6842. @@ -493,18 +493,22 @@
  6843. return 0;
  6844. }
  6845.  
  6846. -struct {
  6847. +struct vbo {
  6848. __isl_give isl_val *(*fn)(__isl_take isl_val *v1,
  6849. __isl_take isl_val *v2);
  6850. -} val_bin_op[] = {
  6851. - ['+'] = { &isl_val_add },
  6852. - ['-'] = { &isl_val_sub },
  6853. - ['*'] = { &isl_val_mul },
  6854. - ['/'] = { &isl_val_div },
  6855. - ['g'] = { &isl_val_gcd },
  6856. - ['m'] = { &isl_val_min },
  6857. - ['M'] = { &isl_val_max },
  6858. -};
  6859. +} vbo;
  6860. +struct vbo val_bin_op[256];
  6861. +
  6862. +void setup_val_bin_ops()
  6863. +{
  6864. + val_bin_op['+'].fn=&isl_val_add;
  6865. + val_bin_op['-'].fn=&isl_val_sub;
  6866. + val_bin_op['*'].fn=&isl_val_mul;
  6867. + val_bin_op['/'].fn=&isl_val_div;
  6868. + val_bin_op['g'].fn=&isl_val_gcd;
  6869. + val_bin_op['m'].fn=&isl_val_min;
  6870. + val_bin_op['M'].fn=&isl_val_max;
  6871. +}
  6872.  
  6873. struct {
  6874. const char *arg1;
  6875. @@ -4344,14 +4348,18 @@
  6876. return 0;
  6877. }
  6878.  
  6879. -struct {
  6880. +struct abo {
  6881. __isl_give isl_aff *(*fn)(__isl_take isl_aff *aff1,
  6882. __isl_take isl_aff *aff2);
  6883. -} aff_bin_op[] = {
  6884. - ['+'] = { &isl_aff_add },
  6885. - ['-'] = { &isl_aff_sub },
  6886. - ['*'] = { &isl_aff_mul },
  6887. - ['/'] = { &isl_aff_div },
  6888. +} abo;
  6889. +struct abo aff_bin_op[256];
  6890. +
  6891. +void setup_aff_bin_ops()
  6892. +{
  6893. + aff_bin_op['+'].fn=&isl_aff_add;
  6894. + aff_bin_op['-'].fn=&isl_aff_sub;
  6895. + aff_bin_op['*'].fn=&isl_aff_mul;
  6896. + aff_bin_op['/'].fn=&isl_aff_div;
  6897. };
  6898.  
  6899. struct {
  6900. @@ -6943,6 +6951,9 @@
  6901. struct isl_ctx *ctx;
  6902. struct isl_options *options;
  6903.  
  6904. + setup_val_bin_ops();
  6905. + setup_aff_bin_ops();
  6906. +
  6907. options = isl_options_new_with_defaults();
  6908. assert(options);
  6909. argc = isl_options_parse(options, argc, argv, ISL_ARG_ALL);
  6910. diff -Naur gcc-9.5.0/isl-0.18/isl_test.c.rej gcc-9.5.0-irix/isl-0.18/isl_test.c.rej
  6911. --- gcc-9.5.0/isl-0.18/isl_test.c.rej 1969-12-31 19:00:00.000000000 +0000
  6912. +++ gcc-9.5.0-irix/isl-0.18/isl_test.c.rej 2024-12-22 11:54:27.424405600 +0000
  6913. @@ -0,0 +1,70 @@
  6914. +--- isl_test.c 2016-12-15 11:27:30.000000000 +0000
  6915. ++++ isl_test.c 2019-05-30 19:29:59.117169440 +0000
  6916. +@@ -493,18 +493,22 @@
  6917. + return 0;
  6918. + }
  6919. +
  6920. +-struct {
  6921. ++struct vbo {
  6922. + __isl_give isl_val *(*fn)(__isl_take isl_val *v1,
  6923. + __isl_take isl_val *v2);
  6924. +-} val_bin_op[] = {
  6925. +- ['+'] = { &isl_val_add },
  6926. +- ['-'] = { &isl_val_sub },
  6927. +- ['*'] = { &isl_val_mul },
  6928. +- ['/'] = { &isl_val_div },
  6929. +- ['g'] = { &isl_val_gcd },
  6930. +- ['m'] = { &isl_val_min },
  6931. +- ['M'] = { &isl_val_max },
  6932. +-};
  6933. ++} vbo;
  6934. ++struct vbo val_bin_op[256];
  6935. ++
  6936. ++void setup_val_bin_ops()
  6937. ++{
  6938. ++ val_bin_op['+'].fn=&isl_val_add;
  6939. ++ val_bin_op['-'].fn=&isl_val_sub;
  6940. ++ val_bin_op['*'].fn=&isl_val_mul;
  6941. ++ val_bin_op['/'].fn=&isl_val_div;
  6942. ++ val_bin_op['g'].fn=&isl_val_gcd;
  6943. ++ val_bin_op['m'].fn=&isl_val_min;
  6944. ++ val_bin_op['M'].fn=&isl_val_max;
  6945. ++}
  6946. +
  6947. + struct {
  6948. + const char *arg1;
  6949. +@@ -4344,14 +4348,18 @@
  6950. + return 0;
  6951. + }
  6952. +
  6953. +-struct {
  6954. ++struct abo {
  6955. + __isl_give isl_aff *(*fn)(__isl_take isl_aff *aff1,
  6956. + __isl_take isl_aff *aff2);
  6957. +-} aff_bin_op[] = {
  6958. +- ['+'] = { &isl_aff_add },
  6959. +- ['-'] = { &isl_aff_sub },
  6960. +- ['*'] = { &isl_aff_mul },
  6961. +- ['/'] = { &isl_aff_div },
  6962. ++} abo;
  6963. ++struct abo aff_bin_op[256];
  6964. ++
  6965. ++void setup_aff_bin_ops()
  6966. ++{
  6967. ++ aff_bin_op['+'].fn=&isl_aff_add;
  6968. ++ aff_bin_op['-'].fn=&isl_aff_sub;
  6969. ++ aff_bin_op['*'].fn=&isl_aff_mul;
  6970. ++ aff_bin_op['/'].fn=&isl_aff_div;
  6971. + };
  6972. +
  6973. + struct {
  6974. +@@ -6943,6 +6951,9 @@
  6975. + struct isl_ctx *ctx;
  6976. + struct isl_options *options;
  6977. +
  6978. ++ setup_val_bin_ops();
  6979. ++ setup_aff_bin_ops();
  6980. ++
  6981. + options = isl_options_new_with_defaults();
  6982. + assert(options);
  6983. + argc = isl_options_parse(options, argc, argv, ISL_ARG_ALL);
  6984. diff -Naur gcc-9.5.0/isl-0.18/libisl.sgifixes.patch gcc-9.5.0-irix/isl-0.18/libisl.sgifixes.patch
  6985. --- gcc-9.5.0/isl-0.18/libisl.sgifixes.patch 1969-12-31 19:00:00.000000000 +0000
  6986. +++ gcc-9.5.0-irix/isl-0.18/libisl.sgifixes.patch 2024-12-22 11:54:16.607330400 +0000
  6987. @@ -0,0 +1,945 @@
  6988. +diff -u -r -w isl-0.18/isl_schedule_tree.c isl-0.18-patched/isl_schedule_tree.c
  6989. +--- isl-0.18/isl_schedule_tree.c 2016-12-15 11:27:30.000000000 +0000
  6990. ++++ isl-0.18-patched/isl_schedule_tree.c 2019-05-30 19:16:57.970849120 +0000
  6991. +@@ -84,45 +84,45 @@
  6992. + "allocation should have failed",
  6993. + isl_schedule_tree_free(dup));
  6994. + case isl_schedule_node_band:
  6995. +- dup->band = isl_schedule_band_copy(tree->band);
  6996. +- if (!dup->band)
  6997. ++ dup->anonunion.band = isl_schedule_band_copy(tree->anonunion.band);
  6998. ++ if (!dup->anonunion.band)
  6999. + return isl_schedule_tree_free(dup);
  7000. + break;
  7001. + case isl_schedule_node_context:
  7002. +- dup->context = isl_set_copy(tree->context);
  7003. +- if (!dup->context)
  7004. ++ dup->anonunion.context = isl_set_copy(tree->anonunion.context);
  7005. ++ if (!dup->anonunion.context)
  7006. + return isl_schedule_tree_free(dup);
  7007. + break;
  7008. + case isl_schedule_node_domain:
  7009. +- dup->domain = isl_union_set_copy(tree->domain);
  7010. +- if (!dup->domain)
  7011. ++ dup->anonunion.domain = isl_union_set_copy(tree->anonunion.domain);
  7012. ++ if (!dup->anonunion.domain)
  7013. + return isl_schedule_tree_free(dup);
  7014. + break;
  7015. + case isl_schedule_node_expansion:
  7016. +- dup->contraction =
  7017. +- isl_union_pw_multi_aff_copy(tree->contraction);
  7018. +- dup->expansion = isl_union_map_copy(tree->expansion);
  7019. +- if (!dup->contraction || !dup->expansion)
  7020. ++ dup->anonunion.anonstruct.contraction =
  7021. ++ isl_union_pw_multi_aff_copy(tree->anonunion.anonstruct.contraction);
  7022. ++ dup->anonunion.anonstruct.expansion = isl_union_map_copy(tree->anonunion.anonstruct.expansion);
  7023. ++ if (!dup->anonunion.anonstruct.contraction || !dup->anonunion.anonstruct.expansion)
  7024. + return isl_schedule_tree_free(dup);
  7025. + break;
  7026. + case isl_schedule_node_extension:
  7027. +- dup->extension = isl_union_map_copy(tree->extension);
  7028. +- if (!dup->extension)
  7029. ++ dup->anonunion.extension = isl_union_map_copy(tree->anonunion.extension);
  7030. ++ if (!dup->anonunion.extension)
  7031. + return isl_schedule_tree_free(dup);
  7032. + break;
  7033. + case isl_schedule_node_filter:
  7034. +- dup->filter = isl_union_set_copy(tree->filter);
  7035. +- if (!dup->filter)
  7036. ++ dup->anonunion.filter = isl_union_set_copy(tree->anonunion.filter);
  7037. ++ if (!dup->anonunion.filter)
  7038. + return isl_schedule_tree_free(dup);
  7039. + break;
  7040. + case isl_schedule_node_guard:
  7041. +- dup->guard = isl_set_copy(tree->guard);
  7042. +- if (!dup->guard)
  7043. ++ dup->anonunion.guard = isl_set_copy(tree->anonunion.guard);
  7044. ++ if (!dup->anonunion.guard)
  7045. + return isl_schedule_tree_free(dup);
  7046. + break;
  7047. + case isl_schedule_node_mark:
  7048. +- dup->mark = isl_id_copy(tree->mark);
  7049. +- if (!dup->mark)
  7050. ++ dup->anonunion.mark = isl_id_copy(tree->anonunion.mark);
  7051. ++ if (!dup->anonunion.mark)
  7052. + return isl_schedule_tree_free(dup);
  7053. + break;
  7054. + case isl_schedule_node_leaf:
  7055. +@@ -180,29 +180,29 @@
  7056. +
  7057. + switch (tree->type) {
  7058. + case isl_schedule_node_band:
  7059. +- isl_schedule_band_free(tree->band);
  7060. ++ isl_schedule_band_free(tree->anonunion.band);
  7061. + break;
  7062. + case isl_schedule_node_context:
  7063. +- isl_set_free(tree->context);
  7064. ++ isl_set_free(tree->anonunion.context);
  7065. + break;
  7066. + case isl_schedule_node_domain:
  7067. +- isl_union_set_free(tree->domain);
  7068. ++ isl_union_set_free(tree->anonunion.domain);
  7069. + break;
  7070. + case isl_schedule_node_expansion:
  7071. +- isl_union_pw_multi_aff_free(tree->contraction);
  7072. +- isl_union_map_free(tree->expansion);
  7073. ++ isl_union_pw_multi_aff_free(tree->anonunion.anonstruct.contraction);
  7074. ++ isl_union_map_free(tree->anonunion.anonstruct.expansion);
  7075. + break;
  7076. + case isl_schedule_node_extension:
  7077. +- isl_union_map_free(tree->extension);
  7078. ++ isl_union_map_free(tree->anonunion.extension);
  7079. + break;
  7080. + case isl_schedule_node_filter:
  7081. +- isl_union_set_free(tree->filter);
  7082. ++ isl_union_set_free(tree->anonunion.filter);
  7083. + break;
  7084. + case isl_schedule_node_guard:
  7085. +- isl_set_free(tree->guard);
  7086. ++ isl_set_free(tree->anonunion.guard);
  7087. + break;
  7088. + case isl_schedule_node_mark:
  7089. +- isl_id_free(tree->mark);
  7090. ++ isl_id_free(tree->anonunion.mark);
  7091. + break;
  7092. + case isl_schedule_node_sequence:
  7093. + case isl_schedule_node_set:
  7094. +@@ -241,7 +241,7 @@
  7095. + if (!tree)
  7096. + goto error;
  7097. +
  7098. +- tree->band = band;
  7099. ++ tree->anonunion.band = band;
  7100. + tree->anchored = isl_schedule_band_is_anchored(band);
  7101. +
  7102. + return tree;
  7103. +@@ -268,7 +268,7 @@
  7104. + if (!tree)
  7105. + goto error;
  7106. +
  7107. +- tree->context = context;
  7108. ++ tree->anonunion.context = context;
  7109. + tree->anchored = 1;
  7110. +
  7111. + return tree;
  7112. +@@ -293,7 +293,7 @@
  7113. + if (!tree)
  7114. + goto error;
  7115. +
  7116. +- tree->domain = domain;
  7117. ++ tree->anonunion.domain = domain;
  7118. +
  7119. + return tree;
  7120. + error:
  7121. +@@ -319,8 +319,8 @@
  7122. + if (!tree)
  7123. + goto error;
  7124. +
  7125. +- tree->contraction = contraction;
  7126. +- tree->expansion = expansion;
  7127. ++ tree->anonunion.anonstruct.contraction = contraction;
  7128. ++ tree->anonunion.anonstruct.expansion = expansion;
  7129. +
  7130. + return tree;
  7131. + error:
  7132. +@@ -348,7 +348,7 @@
  7133. + if (!tree)
  7134. + goto error;
  7135. +
  7136. +- tree->extension = extension;
  7137. ++ tree->anonunion.extension = extension;
  7138. + tree->anchored = 1;
  7139. +
  7140. + return tree;
  7141. +@@ -373,7 +373,7 @@
  7142. + if (!tree)
  7143. + goto error;
  7144. +
  7145. +- tree->filter = filter;
  7146. ++ tree->anonunion.filter = filter;
  7147. +
  7148. + return tree;
  7149. + error:
  7150. +@@ -399,7 +399,7 @@
  7151. + if (!tree)
  7152. + goto error;
  7153. +
  7154. +- tree->guard = guard;
  7155. ++ tree->anonunion.guard = guard;
  7156. + tree->anchored = 1;
  7157. +
  7158. + return tree;
  7159. +@@ -425,7 +425,7 @@
  7160. + if (!tree)
  7161. + goto error;
  7162. +
  7163. +- tree->mark = mark;
  7164. ++ tree->anonunion.mark = mark;
  7165. +
  7166. + return tree;
  7167. + error:
  7168. +@@ -456,7 +456,7 @@
  7169. + case isl_schedule_node_error:
  7170. + return -1;
  7171. + case isl_schedule_node_band:
  7172. +- return isl_schedule_band_is_anchored(tree->band);
  7173. ++ return isl_schedule_band_is_anchored(tree->anonunion.band);
  7174. + case isl_schedule_node_context:
  7175. + case isl_schedule_node_extension:
  7176. + case isl_schedule_node_guard:
  7177. +@@ -639,34 +639,34 @@
  7178. +
  7179. + switch (tree1->type) {
  7180. + case isl_schedule_node_band:
  7181. +- equal = isl_schedule_band_plain_is_equal(tree1->band,
  7182. +- tree2->band);
  7183. ++ equal = isl_schedule_band_plain_is_equal(tree1->anonunion.band,
  7184. ++ tree2->anonunion.band);
  7185. + break;
  7186. + case isl_schedule_node_context:
  7187. +- equal = isl_set_is_equal(tree1->context, tree2->context);
  7188. ++ equal = isl_set_is_equal(tree1->anonunion.context, tree2->anonunion.context);
  7189. + break;
  7190. + case isl_schedule_node_domain:
  7191. +- equal = isl_union_set_is_equal(tree1->domain, tree2->domain);
  7192. ++ equal = isl_union_set_is_equal(tree1->anonunion.domain, tree2->anonunion.domain);
  7193. + break;
  7194. + case isl_schedule_node_expansion:
  7195. +- equal = isl_union_map_is_equal(tree1->expansion,
  7196. +- tree2->expansion);
  7197. ++ equal = isl_union_map_is_equal(tree1->anonunion.anonstruct.expansion,
  7198. ++ tree2->anonunion.anonstruct.expansion);
  7199. + if (equal >= 0 && equal)
  7200. + equal = isl_union_pw_multi_aff_plain_is_equal(
  7201. +- tree1->contraction, tree2->contraction);
  7202. ++ tree1->anonunion.anonstruct.contraction, tree2->anonunion.anonstruct.contraction);
  7203. + break;
  7204. + case isl_schedule_node_extension:
  7205. +- equal = isl_union_map_is_equal(tree1->extension,
  7206. +- tree2->extension);
  7207. ++ equal = isl_union_map_is_equal(tree1->anonunion.extension,
  7208. ++ tree2->anonunion.extension);
  7209. + break;
  7210. + case isl_schedule_node_filter:
  7211. +- equal = isl_union_set_is_equal(tree1->filter, tree2->filter);
  7212. ++ equal = isl_union_set_is_equal(tree1->anonunion.filter, tree2->anonunion.filter);
  7213. + break;
  7214. + case isl_schedule_node_guard:
  7215. +- equal = isl_set_is_equal(tree1->guard, tree2->guard);
  7216. ++ equal = isl_set_is_equal(tree1->anonunion.guard, tree2->anonunion.guard);
  7217. + break;
  7218. + case isl_schedule_node_mark:
  7219. +- equal = tree1->mark == tree2->mark;
  7220. ++ equal = tree1->anonunion.mark == tree2->anonunion.mark;
  7221. + break;
  7222. + case isl_schedule_node_leaf:
  7223. + case isl_schedule_node_sequence:
  7224. +@@ -1002,7 +1002,7 @@
  7225. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  7226. + "not a band node", return 0);
  7227. +
  7228. +- return isl_schedule_band_n_member(tree->band);
  7229. ++ return isl_schedule_band_n_member(tree->anonunion.band);
  7230. + }
  7231. +
  7232. + /* Is the band member at position "pos" of the band tree root
  7233. +@@ -1018,7 +1018,7 @@
  7234. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  7235. + "not a band node", return isl_bool_error);
  7236. +
  7237. +- return isl_schedule_band_member_get_coincident(tree->band, pos);
  7238. ++ return isl_schedule_band_member_get_coincident(tree->anonunion.band, pos);
  7239. + }
  7240. +
  7241. + /* Mark the given band member as being coincident or not
  7242. +@@ -1039,9 +1039,9 @@
  7243. + if (!tree)
  7244. + return NULL;
  7245. +
  7246. +- tree->band = isl_schedule_band_member_set_coincident(tree->band, pos,
  7247. ++ tree->anonunion.band = isl_schedule_band_member_set_coincident(tree->anonunion.band, pos,
  7248. + coincident);
  7249. +- if (!tree->band)
  7250. ++ if (!tree->anonunion.band)
  7251. + return isl_schedule_tree_free(tree);
  7252. + return tree;
  7253. + }
  7254. +@@ -1058,7 +1058,7 @@
  7255. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  7256. + "not a band node", return isl_bool_error);
  7257. +
  7258. +- return isl_schedule_band_get_permutable(tree->band);
  7259. ++ return isl_schedule_band_get_permutable(tree->anonunion.band);
  7260. + }
  7261. +
  7262. + /* Mark the band tree root permutable or not according to "permutable"?
  7263. +@@ -1077,8 +1077,8 @@
  7264. + if (!tree)
  7265. + return NULL;
  7266. +
  7267. +- tree->band = isl_schedule_band_set_permutable(tree->band, permutable);
  7268. +- if (!tree->band)
  7269. ++ tree->anonunion.band = isl_schedule_band_set_permutable(tree->anonunion.band, permutable);
  7270. ++ if (!tree->anonunion.band)
  7271. + return isl_schedule_tree_free(tree);
  7272. + return tree;
  7273. + }
  7274. +@@ -1095,7 +1095,7 @@
  7275. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  7276. + "not a band node", return NULL);
  7277. +
  7278. +- return isl_schedule_band_get_space(tree->band);
  7279. ++ return isl_schedule_band_get_space(tree->anonunion.band);
  7280. + }
  7281. +
  7282. + /* Intersect the domain of the band schedule of the band tree root
  7283. +@@ -1111,8 +1111,8 @@
  7284. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  7285. + "not a band node", goto error);
  7286. +
  7287. +- tree->band = isl_schedule_band_intersect_domain(tree->band, domain);
  7288. +- if (!tree->band)
  7289. ++ tree->anonunion.band = isl_schedule_band_intersect_domain(tree->anonunion.band, domain);
  7290. ++ if (!tree->anonunion.band)
  7291. + return isl_schedule_tree_free(tree);
  7292. +
  7293. + return tree;
  7294. +@@ -1134,7 +1134,7 @@
  7295. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  7296. + "not a band node", return NULL);
  7297. +
  7298. +- return isl_schedule_band_get_partial_schedule(tree->band);
  7299. ++ return isl_schedule_band_get_partial_schedule(tree->anonunion.band);
  7300. + }
  7301. +
  7302. + /* Replace the schedule of the band tree root by "schedule".
  7303. +@@ -1150,7 +1150,7 @@
  7304. + if (tree->type != isl_schedule_node_band)
  7305. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  7306. + "not a band node", return NULL);
  7307. +- tree->band = isl_schedule_band_set_partial_schedule(tree->band,
  7308. ++ tree->anonunion.band = isl_schedule_band_set_partial_schedule(tree->anonunion.band,
  7309. + schedule);
  7310. +
  7311. + return tree;
  7312. +@@ -1173,7 +1173,7 @@
  7313. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  7314. + "not a band node", return isl_ast_loop_error);
  7315. +
  7316. +- return isl_schedule_band_member_get_ast_loop_type(tree->band, pos);
  7317. ++ return isl_schedule_band_member_get_ast_loop_type(tree->anonunion.band, pos);
  7318. + }
  7319. +
  7320. + /* Set the loop AST generation type for the band member of the band tree root
  7321. +@@ -1191,9 +1191,9 @@
  7322. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  7323. + "not a band node", return isl_schedule_tree_free(tree));
  7324. +
  7325. +- tree->band = isl_schedule_band_member_set_ast_loop_type(tree->band,
  7326. ++ tree->anonunion.band = isl_schedule_band_member_set_ast_loop_type(tree->anonunion.band,
  7327. + pos, type);
  7328. +- if (!tree->band)
  7329. ++ if (!tree->anonunion.band)
  7330. + return isl_schedule_tree_free(tree);
  7331. +
  7332. + return tree;
  7333. +@@ -1212,7 +1212,7 @@
  7334. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  7335. + "not a band node", return isl_ast_loop_error);
  7336. +
  7337. +- return isl_schedule_band_member_get_isolate_ast_loop_type(tree->band,
  7338. ++ return isl_schedule_band_member_get_isolate_ast_loop_type(tree->anonunion.band,
  7339. + pos);
  7340. + }
  7341. +
  7342. +@@ -1232,9 +1232,9 @@
  7343. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  7344. + "not a band node", return isl_schedule_tree_free(tree));
  7345. +
  7346. +- tree->band = isl_schedule_band_member_set_isolate_ast_loop_type(
  7347. +- tree->band, pos, type);
  7348. +- if (!tree->band)
  7349. ++ tree->anonunion.band = isl_schedule_band_member_set_isolate_ast_loop_type(
  7350. ++ tree->anonunion.band, pos, type);
  7351. ++ if (!tree->anonunion.band)
  7352. + return isl_schedule_tree_free(tree);
  7353. +
  7354. + return tree;
  7355. +@@ -1252,7 +1252,7 @@
  7356. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  7357. + "not a band node", return NULL);
  7358. +
  7359. +- return isl_schedule_band_get_ast_build_options(tree->band);
  7360. ++ return isl_schedule_band_get_ast_build_options(tree->anonunion.band);
  7361. + }
  7362. +
  7363. + /* Replace the AST build options associated to band tree root by "options".
  7364. +@@ -1273,9 +1273,9 @@
  7365. + "not a band node", goto error);
  7366. +
  7367. + was_anchored = isl_schedule_tree_is_anchored(tree);
  7368. +- tree->band = isl_schedule_band_set_ast_build_options(tree->band,
  7369. ++ tree->anonunion.band = isl_schedule_band_set_ast_build_options(tree->anonunion.band,
  7370. + options);
  7371. +- if (!tree->band)
  7372. ++ if (!tree->anonunion.band)
  7373. + return isl_schedule_tree_free(tree);
  7374. + if (isl_schedule_tree_is_anchored(tree) != was_anchored)
  7375. + tree = isl_schedule_tree_update_anchored(tree);
  7376. +@@ -1300,7 +1300,7 @@
  7377. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  7378. + "not a band node", return NULL);
  7379. +
  7380. +- return isl_schedule_band_get_ast_isolate_option(tree->band, depth);
  7381. ++ return isl_schedule_band_get_ast_isolate_option(tree->anonunion.band, depth);
  7382. + }
  7383. +
  7384. + /* Return the context of the context tree root.
  7385. +@@ -1315,7 +1315,7 @@
  7386. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  7387. + "not a context node", return NULL);
  7388. +
  7389. +- return isl_set_copy(tree->context);
  7390. ++ return isl_set_copy(tree->anonunion.context);
  7391. + }
  7392. +
  7393. + /* Return the domain of the domain tree root.
  7394. +@@ -1330,7 +1330,7 @@
  7395. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  7396. + "not a domain node", return NULL);
  7397. +
  7398. +- return isl_union_set_copy(tree->domain);
  7399. ++ return isl_union_set_copy(tree->anonunion.domain);
  7400. + }
  7401. +
  7402. + /* Replace the domain of domain tree root "tree" by "domain".
  7403. +@@ -1346,8 +1346,8 @@
  7404. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  7405. + "not a domain node", goto error);
  7406. +
  7407. +- isl_union_set_free(tree->domain);
  7408. +- tree->domain = domain;
  7409. ++ isl_union_set_free(tree->anonunion.domain);
  7410. ++ tree->anonunion.domain = domain;
  7411. +
  7412. + return tree;
  7413. + error:
  7414. +@@ -1368,7 +1368,7 @@
  7415. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  7416. + "not an expansion node", return NULL);
  7417. +
  7418. +- return isl_union_pw_multi_aff_copy(tree->contraction);
  7419. ++ return isl_union_pw_multi_aff_copy(tree->anonunion.anonstruct.contraction);
  7420. + }
  7421. +
  7422. + /* Return the expansion of the expansion tree root.
  7423. +@@ -1383,7 +1383,7 @@
  7424. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  7425. + "not an expansion node", return NULL);
  7426. +
  7427. +- return isl_union_map_copy(tree->expansion);
  7428. ++ return isl_union_map_copy(tree->anonunion.anonstruct.expansion);
  7429. + }
  7430. +
  7431. + /* Replace the contraction and the expansion of the expansion tree root "tree"
  7432. +@@ -1403,10 +1403,10 @@
  7433. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  7434. + "not an expansion node", return NULL);
  7435. +
  7436. +- isl_union_pw_multi_aff_free(tree->contraction);
  7437. +- tree->contraction = contraction;
  7438. +- isl_union_map_free(tree->expansion);
  7439. +- tree->expansion = expansion;
  7440. ++ isl_union_pw_multi_aff_free(tree->anonunion.anonstruct.contraction);
  7441. ++ tree->anonunion.anonstruct.contraction = contraction;
  7442. ++ isl_union_map_free(tree->anonunion.anonstruct.expansion);
  7443. ++ tree->anonunion.anonstruct.expansion = expansion;
  7444. +
  7445. + return tree;
  7446. + error:
  7447. +@@ -1428,7 +1428,7 @@
  7448. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  7449. + "not an extension node", return NULL);
  7450. +
  7451. +- return isl_union_map_copy(tree->extension);
  7452. ++ return isl_union_map_copy(tree->anonunion.extension);
  7453. + }
  7454. +
  7455. + /* Replace the extension of extension tree root "tree" by "extension".
  7456. +@@ -1443,8 +1443,8 @@
  7457. + if (tree->type != isl_schedule_node_extension)
  7458. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  7459. + "not an extension node", return NULL);
  7460. +- isl_union_map_free(tree->extension);
  7461. +- tree->extension = extension;
  7462. ++ isl_union_map_free(tree->anonunion.extension);
  7463. ++ tree->anonunion.extension = extension;
  7464. +
  7465. + return tree;
  7466. + error:
  7467. +@@ -1465,7 +1465,7 @@
  7468. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  7469. + "not a filter node", return NULL);
  7470. +
  7471. +- return isl_union_set_copy(tree->filter);
  7472. ++ return isl_union_set_copy(tree->anonunion.filter);
  7473. + }
  7474. +
  7475. + /* Replace the filter of the filter tree root by "filter".
  7476. +@@ -1481,8 +1481,8 @@
  7477. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  7478. + "not a filter node", return NULL);
  7479. +
  7480. +- isl_union_set_free(tree->filter);
  7481. +- tree->filter = filter;
  7482. ++ isl_union_set_free(tree->anonunion.filter);
  7483. ++ tree->anonunion.filter = filter;
  7484. +
  7485. + return tree;
  7486. + error:
  7487. +@@ -1503,7 +1503,7 @@
  7488. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  7489. + "not a guard node", return NULL);
  7490. +
  7491. +- return isl_set_copy(tree->guard);
  7492. ++ return isl_set_copy(tree->anonunion.guard);
  7493. + }
  7494. +
  7495. + /* Return the mark identifier of the mark tree root "tree".
  7496. +@@ -1518,7 +1518,7 @@
  7497. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid,
  7498. + "not a mark node", return NULL);
  7499. +
  7500. +- return isl_id_copy(tree->mark);
  7501. ++ return isl_id_copy(tree->anonunion.mark);
  7502. + }
  7503. +
  7504. + /* Set dim to the range dimension of "map" and abort the search.
  7505. +@@ -1828,7 +1828,7 @@
  7506. + case isl_schedule_node_band:
  7507. + if (isl_schedule_tree_band_n_member(tree) == 0)
  7508. + return subtree_schedule_extend_child(tree, outer);
  7509. +- mupa = isl_schedule_band_get_partial_schedule(tree->band);
  7510. ++ mupa = isl_schedule_band_get_partial_schedule(tree->anonunion.band);
  7511. + umap = isl_union_map_from_multi_union_pw_aff(mupa);
  7512. + outer = isl_union_map_flat_range_product(outer, umap);
  7513. + umap = subtree_schedule_extend_child(tree, outer);
  7514. +@@ -1940,7 +1940,7 @@
  7515. + isl_error_internal,
  7516. + "0D band should be handled by caller",
  7517. + return NULL);
  7518. +- mupa = isl_schedule_band_get_partial_schedule(tree->band);
  7519. ++ mupa = isl_schedule_band_get_partial_schedule(tree->anonunion.band);
  7520. + domain = isl_multi_union_pw_aff_domain(mupa);
  7521. + domain = isl_union_set_universe(domain);
  7522. + break;
  7523. +@@ -2008,8 +2008,8 @@
  7524. + if (!tree)
  7525. + goto error;
  7526. +
  7527. +- tree->band = isl_schedule_band_scale(tree->band, mv);
  7528. +- if (!tree->band)
  7529. ++ tree->anonunion.band = isl_schedule_band_scale(tree->anonunion.band, mv);
  7530. ++ if (!tree->anonunion.band)
  7531. + return isl_schedule_tree_free(tree);
  7532. +
  7533. + return tree;
  7534. +@@ -2035,8 +2035,8 @@
  7535. + if (!tree)
  7536. + goto error;
  7537. +
  7538. +- tree->band = isl_schedule_band_scale_down(tree->band, mv);
  7539. +- if (!tree->band)
  7540. ++ tree->anonunion.band = isl_schedule_band_scale_down(tree->anonunion.band, mv);
  7541. ++ if (!tree->anonunion.band)
  7542. + return isl_schedule_tree_free(tree);
  7543. +
  7544. + return tree;
  7545. +@@ -2062,8 +2062,8 @@
  7546. + if (!tree)
  7547. + goto error;
  7548. +
  7549. +- tree->band = isl_schedule_band_mod(tree->band, mv);
  7550. +- if (!tree->band)
  7551. ++ tree->anonunion.band = isl_schedule_band_mod(tree->anonunion.band, mv);
  7552. ++ if (!tree->anonunion.band)
  7553. + return isl_schedule_tree_free(tree);
  7554. +
  7555. + return tree;
  7556. +@@ -2089,8 +2089,8 @@
  7557. + if (!tree)
  7558. + goto error;
  7559. +
  7560. +- tree->band = isl_schedule_band_shift(tree->band, shift);
  7561. +- if (!tree->band)
  7562. ++ tree->anonunion.band = isl_schedule_band_shift(tree->anonunion.band, shift);
  7563. ++ if (!tree->anonunion.band)
  7564. + return isl_schedule_tree_free(tree);
  7565. +
  7566. + return tree;
  7567. +@@ -2165,12 +2165,12 @@
  7568. + if (!tree || !child)
  7569. + goto error;
  7570. +
  7571. +- tree->band = isl_schedule_band_tile(tree->band,
  7572. ++ tree->anonunion.band = isl_schedule_band_tile(tree->anonunion.band,
  7573. + isl_multi_val_copy(sizes));
  7574. +- if (!tree->band)
  7575. ++ if (!tree->anonunion.band)
  7576. + goto error;
  7577. +- child->band = isl_schedule_band_point(child->band, tree->band, sizes);
  7578. +- if (!child->band)
  7579. ++ child->anonunion.band = isl_schedule_band_point(child->anonunion.band, tree->anonunion.band, sizes);
  7580. ++ if (!child->anonunion.band)
  7581. + child = isl_schedule_tree_free(child);
  7582. +
  7583. + tree = isl_schedule_tree_replace_child(tree, 0, child);
  7584. +@@ -2295,14 +2295,14 @@
  7585. + isolate = isl_schedule_tree_band_get_ast_isolate_option(tree, depth);
  7586. + tree_isolate = isolate_initial(isolate, pos, n - pos);
  7587. + child_isolate = isolate_final(isolate, pos, n - pos);
  7588. +- child->band = isl_schedule_band_drop(child->band, 0, pos);
  7589. +- child->band = isl_schedule_band_replace_ast_build_option(child->band,
  7590. ++ child->anonunion.band = isl_schedule_band_drop(child->anonunion.band, 0, pos);
  7591. ++ child->anonunion.band = isl_schedule_band_replace_ast_build_option(child->anonunion.band,
  7592. + isl_set_copy(isolate), child_isolate);
  7593. +- tree->band = isl_schedule_band_drop(tree->band, pos, n - pos);
  7594. +- tree->band = isl_schedule_band_replace_ast_build_option(tree->band,
  7595. ++ tree->anonunion.band = isl_schedule_band_drop(tree->anonunion.band, pos, n - pos);
  7596. ++ tree->anonunion.band = isl_schedule_band_replace_ast_build_option(tree->anonunion.band,
  7597. + isl_set_copy(isolate), tree_isolate);
  7598. + isl_set_free(isolate);
  7599. +- if (!child->band || !tree->band)
  7600. ++ if (!child->anonunion.band || !tree->anonunion.band)
  7601. + goto error;
  7602. +
  7603. + tree = isl_schedule_tree_replace_child(tree, 0, child);
  7604. +@@ -2369,40 +2369,40 @@
  7605. + case isl_schedule_node_error:
  7606. + return isl_schedule_tree_free(tree);
  7607. + case isl_schedule_node_band:
  7608. +- tree->band = isl_schedule_band_reset_user(tree->band);
  7609. +- if (!tree->band)
  7610. ++ tree->anonunion.band = isl_schedule_band_reset_user(tree->anonunion.band);
  7611. ++ if (!tree->anonunion.band)
  7612. + return isl_schedule_tree_free(tree);
  7613. + break;
  7614. + case isl_schedule_node_context:
  7615. +- tree->context = isl_set_reset_user(tree->context);
  7616. +- if (!tree->context)
  7617. ++ tree->anonunion.context = isl_set_reset_user(tree->anonunion.context);
  7618. ++ if (!tree->anonunion.context)
  7619. + return isl_schedule_tree_free(tree);
  7620. + break;
  7621. + case isl_schedule_node_domain:
  7622. +- tree->domain = isl_union_set_reset_user(tree->domain);
  7623. +- if (!tree->domain)
  7624. ++ tree->anonunion.domain = isl_union_set_reset_user(tree->anonunion.domain);
  7625. ++ if (!tree->anonunion.domain)
  7626. + return isl_schedule_tree_free(tree);
  7627. + break;
  7628. + case isl_schedule_node_expansion:
  7629. +- tree->contraction =
  7630. +- isl_union_pw_multi_aff_reset_user(tree->contraction);
  7631. +- tree->expansion = isl_union_map_reset_user(tree->expansion);
  7632. +- if (!tree->contraction || !tree->expansion)
  7633. ++ tree->anonunion.anonstruct.contraction =
  7634. ++ isl_union_pw_multi_aff_reset_user(tree->anonunion.anonstruct.contraction);
  7635. ++ tree->anonunion.anonstruct.expansion = isl_union_map_reset_user(tree->anonunion.anonstruct.expansion);
  7636. ++ if (!tree->anonunion.anonstruct.contraction || !tree->anonunion.anonstruct.expansion)
  7637. + return isl_schedule_tree_free(tree);
  7638. + break;
  7639. + case isl_schedule_node_extension:
  7640. +- tree->extension = isl_union_map_reset_user(tree->extension);
  7641. +- if (!tree->extension)
  7642. ++ tree->anonunion.extension = isl_union_map_reset_user(tree->anonunion.extension);
  7643. ++ if (!tree->anonunion.extension)
  7644. + return isl_schedule_tree_free(tree);
  7645. + break;
  7646. + case isl_schedule_node_filter:
  7647. +- tree->filter = isl_union_set_reset_user(tree->filter);
  7648. +- if (!tree->filter)
  7649. ++ tree->anonunion.filter = isl_union_set_reset_user(tree->anonunion.filter);
  7650. ++ if (!tree->anonunion.filter)
  7651. + return isl_schedule_tree_free(tree);
  7652. + break;
  7653. + case isl_schedule_node_guard:
  7654. +- tree->guard = isl_set_reset_user(tree->guard);
  7655. +- if (!tree->guard)
  7656. ++ tree->anonunion.guard = isl_set_reset_user(tree->anonunion.guard);
  7657. ++ if (!tree->anonunion.guard)
  7658. + return isl_schedule_tree_free(tree);
  7659. + break;
  7660. + case isl_schedule_node_leaf:
  7661. +@@ -2436,43 +2436,43 @@
  7662. + case isl_schedule_node_error:
  7663. + goto error;
  7664. + case isl_schedule_node_band:
  7665. +- tree->band = isl_schedule_band_align_params(tree->band, space);
  7666. +- if (!tree->band)
  7667. ++ tree->anonunion.band = isl_schedule_band_align_params(tree->anonunion.band, space);
  7668. ++ if (!tree->anonunion.band)
  7669. + return isl_schedule_tree_free(tree);
  7670. + break;
  7671. + case isl_schedule_node_context:
  7672. +- tree->context = isl_set_align_params(tree->context, space);
  7673. +- if (!tree->context)
  7674. ++ tree->anonunion.context = isl_set_align_params(tree->anonunion.context, space);
  7675. ++ if (!tree->anonunion.context)
  7676. + return isl_schedule_tree_free(tree);
  7677. + break;
  7678. + case isl_schedule_node_domain:
  7679. +- tree->domain = isl_union_set_align_params(tree->domain, space);
  7680. +- if (!tree->domain)
  7681. ++ tree->anonunion.domain = isl_union_set_align_params(tree->anonunion.domain, space);
  7682. ++ if (!tree->anonunion.domain)
  7683. + return isl_schedule_tree_free(tree);
  7684. + break;
  7685. + case isl_schedule_node_expansion:
  7686. +- tree->contraction =
  7687. +- isl_union_pw_multi_aff_align_params(tree->contraction,
  7688. ++ tree->anonunion.anonstruct.contraction =
  7689. ++ isl_union_pw_multi_aff_align_params(tree->anonunion.anonstruct.contraction,
  7690. + isl_space_copy(space));
  7691. +- tree->expansion = isl_union_map_align_params(tree->expansion,
  7692. ++ tree->anonunion.anonstruct.expansion = isl_union_map_align_params(tree->anonunion.anonstruct.expansion,
  7693. + space);
  7694. +- if (!tree->contraction || !tree->expansion)
  7695. ++ if (!tree->anonunion.anonstruct.contraction || !tree->anonunion.anonstruct.expansion)
  7696. + return isl_schedule_tree_free(tree);
  7697. + break;
  7698. + case isl_schedule_node_extension:
  7699. +- tree->extension = isl_union_map_align_params(tree->extension,
  7700. ++ tree->anonunion.extension = isl_union_map_align_params(tree->anonunion.extension,
  7701. + space);
  7702. +- if (!tree->extension)
  7703. ++ if (!tree->anonunion.extension)
  7704. + return isl_schedule_tree_free(tree);
  7705. + break;
  7706. + case isl_schedule_node_filter:
  7707. +- tree->filter = isl_union_set_align_params(tree->filter, space);
  7708. +- if (!tree->filter)
  7709. ++ tree->anonunion.filter = isl_union_set_align_params(tree->anonunion.filter, space);
  7710. ++ if (!tree->anonunion.filter)
  7711. + return isl_schedule_tree_free(tree);
  7712. + break;
  7713. + case isl_schedule_node_guard:
  7714. +- tree->guard = isl_set_align_params(tree->guard, space);
  7715. +- if (!tree->guard)
  7716. ++ tree->anonunion.guard = isl_set_align_params(tree->anonunion.guard, space);
  7717. ++ if (!tree->anonunion.guard)
  7718. + return isl_schedule_tree_free(tree);
  7719. + break;
  7720. + case isl_schedule_node_leaf:
  7721. +@@ -2552,30 +2552,30 @@
  7722. + goto error;
  7723. +
  7724. + if (tree->type == isl_schedule_node_band) {
  7725. +- tree->band = isl_schedule_band_pullback_union_pw_multi_aff(
  7726. +- tree->band, upma);
  7727. +- if (!tree->band)
  7728. ++ tree->anonunion.band = isl_schedule_band_pullback_union_pw_multi_aff(
  7729. ++ tree->anonunion.band, upma);
  7730. ++ if (!tree->anonunion.band)
  7731. + return isl_schedule_tree_free(tree);
  7732. + } else if (tree->type == isl_schedule_node_domain) {
  7733. +- tree->domain =
  7734. +- isl_union_set_preimage_union_pw_multi_aff(tree->domain,
  7735. ++ tree->anonunion.domain =
  7736. ++ isl_union_set_preimage_union_pw_multi_aff(tree->anonunion.domain,
  7737. + upma);
  7738. +- if (!tree->domain)
  7739. ++ if (!tree->anonunion.domain)
  7740. + return isl_schedule_tree_free(tree);
  7741. + } else if (tree->type == isl_schedule_node_expansion) {
  7742. + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_unsupported,
  7743. + "cannot pullback expansion node", goto error);
  7744. + } else if (tree->type == isl_schedule_node_extension) {
  7745. +- tree->extension =
  7746. ++ tree->anonunion.extension =
  7747. + isl_union_map_preimage_range_union_pw_multi_aff(
  7748. +- tree->extension, upma);
  7749. +- if (!tree->extension)
  7750. ++ tree->anonunion.extension, upma);
  7751. ++ if (!tree->anonunion.extension)
  7752. + return isl_schedule_tree_free(tree);
  7753. + } else if (tree->type == isl_schedule_node_filter) {
  7754. +- tree->filter =
  7755. +- isl_union_set_preimage_union_pw_multi_aff(tree->filter,
  7756. ++ tree->anonunion.filter =
  7757. ++ isl_union_set_preimage_union_pw_multi_aff(tree->anonunion.filter,
  7758. + upma);
  7759. +- if (!tree->filter)
  7760. ++ if (!tree->anonunion.filter)
  7761. + return isl_schedule_tree_free(tree);
  7762. + }
  7763. +
  7764. +@@ -2600,8 +2600,8 @@
  7765. + if (!tree)
  7766. + goto error;
  7767. +
  7768. +- tree->band = isl_schedule_band_gist(tree->band, context);
  7769. +- if (!tree->band)
  7770. ++ tree->anonunion.band = isl_schedule_band_gist(tree->anonunion.band, context);
  7771. ++ if (!tree->anonunion.band)
  7772. + return isl_schedule_tree_free(tree);
  7773. + return tree;
  7774. + error:
  7775. +@@ -2729,59 +2729,59 @@
  7776. + p = isl_printer_print_str(p, "context");
  7777. + p = isl_printer_yaml_next(p);
  7778. + p = isl_printer_print_str(p, "\"");
  7779. +- p = isl_printer_print_set(p, tree->context);
  7780. ++ p = isl_printer_print_set(p, tree->anonunion.context);
  7781. + p = isl_printer_print_str(p, "\"");
  7782. + break;
  7783. + case isl_schedule_node_domain:
  7784. + p = isl_printer_print_str(p, "domain");
  7785. + p = isl_printer_yaml_next(p);
  7786. + p = isl_printer_print_str(p, "\"");
  7787. +- p = isl_printer_print_union_set(p, tree->domain);
  7788. ++ p = isl_printer_print_union_set(p, tree->anonunion.domain);
  7789. + p = isl_printer_print_str(p, "\"");
  7790. + break;
  7791. + case isl_schedule_node_expansion:
  7792. + p = isl_printer_print_str(p, "contraction");
  7793. + p = isl_printer_yaml_next(p);
  7794. + p = isl_printer_print_str(p, "\"");
  7795. +- p = isl_printer_print_union_pw_multi_aff(p, tree->contraction);
  7796. ++ p = isl_printer_print_union_pw_multi_aff(p, tree->anonunion.anonstruct.contraction);
  7797. + p = isl_printer_print_str(p, "\"");
  7798. + p = isl_printer_yaml_next(p);
  7799. + p = isl_printer_print_str(p, "expansion");
  7800. + p = isl_printer_yaml_next(p);
  7801. + p = isl_printer_print_str(p, "\"");
  7802. +- p = isl_printer_print_union_map(p, tree->expansion);
  7803. ++ p = isl_printer_print_union_map(p, tree->anonunion.anonstruct.expansion);
  7804. + p = isl_printer_print_str(p, "\"");
  7805. + break;
  7806. + case isl_schedule_node_extension:
  7807. + p = isl_printer_print_str(p, "extension");
  7808. + p = isl_printer_yaml_next(p);
  7809. + p = isl_printer_print_str(p, "\"");
  7810. +- p = isl_printer_print_union_map(p, tree->extension);
  7811. ++ p = isl_printer_print_union_map(p, tree->anonunion.extension);
  7812. + p = isl_printer_print_str(p, "\"");
  7813. + break;
  7814. + case isl_schedule_node_filter:
  7815. + p = isl_printer_print_str(p, "filter");
  7816. + p = isl_printer_yaml_next(p);
  7817. + p = isl_printer_print_str(p, "\"");
  7818. +- p = isl_printer_print_union_set(p, tree->filter);
  7819. ++ p = isl_printer_print_union_set(p, tree->anonunion.filter);
  7820. + p = isl_printer_print_str(p, "\"");
  7821. + break;
  7822. + case isl_schedule_node_guard:
  7823. + p = isl_printer_print_str(p, "guard");
  7824. + p = isl_printer_yaml_next(p);
  7825. + p = isl_printer_print_str(p, "\"");
  7826. +- p = isl_printer_print_set(p, tree->guard);
  7827. ++ p = isl_printer_print_set(p, tree->anonunion.guard);
  7828. + p = isl_printer_print_str(p, "\"");
  7829. + break;
  7830. + case isl_schedule_node_mark:
  7831. + p = isl_printer_print_str(p, "mark");
  7832. + p = isl_printer_yaml_next(p);
  7833. + p = isl_printer_print_str(p, "\"");
  7834. +- p = isl_printer_print_str(p, isl_id_get_name(tree->mark));
  7835. ++ p = isl_printer_print_str(p, isl_id_get_name(tree->anonunion.mark));
  7836. + p = isl_printer_print_str(p, "\"");
  7837. + break;
  7838. + case isl_schedule_node_band:
  7839. +- p = print_tree_band(p, tree->band);
  7840. ++ p = print_tree_band(p, tree->anonunion.band);
  7841. + break;
  7842. + }
  7843. + p = isl_printer_yaml_next(p);
  7844. +diff -u -r -w isl-0.18/isl_schedule_tree.h isl-0.18-patched/isl_schedule_tree.h
  7845. +--- isl-0.18/isl_schedule_tree.h 2016-12-12 09:15:44.000000000 +0000
  7846. ++++ isl-0.18-patched/isl_schedule_tree.h 2019-05-30 19:16:57.974657440 +0000
  7847. +@@ -63,12 +63,12 @@
  7848. + struct {
  7849. + isl_union_pw_multi_aff *contraction;
  7850. + isl_union_map *expansion;
  7851. +- };
  7852. ++ } anonstruct;
  7853. + isl_union_map *extension;
  7854. + isl_union_set *filter;
  7855. + isl_set *guard;
  7856. + isl_id *mark;
  7857. +- };
  7858. ++ } anonunion;
  7859. + isl_schedule_tree_list *children;
  7860. + };
  7861. +
  7862. +diff -u -r -w isl-0.18/isl_test.c isl-0.18-patched/isl_test.c
  7863. +--- isl-0.18/isl_test.c 2016-12-15 11:27:30.000000000 +0000
  7864. ++++ isl-0.18-patched/isl_test.c 2019-05-30 19:29:59.117169440 +0000
  7865. +@@ -493,18 +493,22 @@
  7866. + return 0;
  7867. + }
  7868. +
  7869. +-struct {
  7870. ++struct vbo {
  7871. + __isl_give isl_val *(*fn)(__isl_take isl_val *v1,
  7872. + __isl_take isl_val *v2);
  7873. +-} val_bin_op[] = {
  7874. +- ['+'] = { &isl_val_add },
  7875. +- ['-'] = { &isl_val_sub },
  7876. +- ['*'] = { &isl_val_mul },
  7877. +- ['/'] = { &isl_val_div },
  7878. +- ['g'] = { &isl_val_gcd },
  7879. +- ['m'] = { &isl_val_min },
  7880. +- ['M'] = { &isl_val_max },
  7881. +-};
  7882. ++} vbo;
  7883. ++struct vbo val_bin_op[256];
  7884. ++
  7885. ++void setup_val_bin_ops()
  7886. ++{
  7887. ++ val_bin_op['+'].fn=&isl_val_add;
  7888. ++ val_bin_op['-'].fn=&isl_val_sub;
  7889. ++ val_bin_op['*'].fn=&isl_val_mul;
  7890. ++ val_bin_op['/'].fn=&isl_val_div;
  7891. ++ val_bin_op['g'].fn=&isl_val_gcd;
  7892. ++ val_bin_op['m'].fn=&isl_val_min;
  7893. ++ val_bin_op['M'].fn=&isl_val_max;
  7894. ++}
  7895. +
  7896. + struct {
  7897. + const char *arg1;
  7898. +@@ -4344,14 +4348,18 @@
  7899. + return 0;
  7900. + }
  7901. +
  7902. +-struct {
  7903. ++struct abo {
  7904. + __isl_give isl_aff *(*fn)(__isl_take isl_aff *aff1,
  7905. + __isl_take isl_aff *aff2);
  7906. +-} aff_bin_op[] = {
  7907. +- ['+'] = { &isl_aff_add },
  7908. +- ['-'] = { &isl_aff_sub },
  7909. +- ['*'] = { &isl_aff_mul },
  7910. +- ['/'] = { &isl_aff_div },
  7911. ++} abo;
  7912. ++struct abo aff_bin_op[256];
  7913. ++
  7914. ++void setup_aff_bin_ops()
  7915. ++{
  7916. ++ aff_bin_op['+'].fn=&isl_aff_add;
  7917. ++ aff_bin_op['-'].fn=&isl_aff_sub;
  7918. ++ aff_bin_op['*'].fn=&isl_aff_mul;
  7919. ++ aff_bin_op['/'].fn=&isl_aff_div;
  7920. + };
  7921. +
  7922. + struct {
  7923. +@@ -6943,6 +6951,9 @@
  7924. + struct isl_ctx *ctx;
  7925. + struct isl_options *options;
  7926. +
  7927. ++ setup_val_bin_ops();
  7928. ++ setup_aff_bin_ops();
  7929. ++
  7930. + options = isl_options_new_with_defaults();
  7931. + assert(options);
  7932. + argc = isl_options_parse(options, argc, argv, ISL_ARG_ALL);
  7933. diff -Naur gcc-9.5.0/libatomic/config/posix/lock.c gcc-9.5.0-irix/libatomic/config/posix/lock.c
  7934. --- gcc-9.5.0/libatomic/config/posix/lock.c 2022-05-27 03:21:12.803388000 +0000
  7935. +++ gcc-9.5.0-irix/libatomic/config/posix/lock.c 2025-02-14 07:40:08.500590400 +0000
  7936. @@ -54,7 +54,8 @@
  7937. };
  7938.  
  7939. #define NLOCKS (PAGE_SIZE / WATCH_SIZE)
  7940. -static struct lock locks[NLOCKS] = {
  7941. +static struct lock locks[NLOCKS] =
  7942. +{
  7943. [0 ... NLOCKS-1].mutex = PTHREAD_MUTEX_INITIALIZER
  7944. };
  7945.  
  7946. diff -Naur gcc-9.5.0/libgcc/config/mips/irix-crti.S gcc-9.5.0-irix/libgcc/config/mips/irix-crti.S
  7947. --- gcc-9.5.0/libgcc/config/mips/irix-crti.S 1969-12-31 19:00:00.000000000 +0000
  7948. +++ gcc-9.5.0-irix/libgcc/config/mips/irix-crti.S 2025-02-13 08:55:07.787104800 +0000
  7949. @@ -0,0 +1,71 @@
  7950. +/* Copyright (C) 2004, 2008, 2011 Free Software Foundation, Inc.
  7951. +
  7952. +This file is part of GCC.
  7953. +
  7954. +GCC is free software; you can redistribute it and/or modify it under
  7955. +the terms of the GNU General Public License as published by the Free
  7956. +Software Foundation; either version 3, or (at your option) any later
  7957. +version.
  7958. +
  7959. +GCC is distributed in the hope that it will be useful, but WITHOUT ANY
  7960. +WARRANTY; without even the implied warranty of MERCHANTABILITY or
  7961. +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  7962. +for more details.
  7963. +
  7964. +Under Section 7 of GPL version 3, you are granted additional
  7965. +permissions described in the GCC Runtime Library Exception, version
  7966. +3.1, as published by the Free Software Foundation.
  7967. +
  7968. +You should have received a copy of the GNU General Public License and
  7969. +a copy of the GCC Runtime Library Exception along with this program;
  7970. +see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  7971. +<http://www.gnu.org/licenses/>. */
  7972. +
  7973. + .abicalls
  7974. + .set noreorder
  7975. + .set nomacro
  7976. +
  7977. +/* The GNU and SGI linkers differ in their implementation of -init and -fini.
  7978. + With the GNU linker, there can only be a single -init option, and the
  7979. + linker simply sets DT_INIT to that value. gcc's initialization and
  7980. + finalization code can go directly in .init, with the prologue and
  7981. + epilogue of the main initialization routine being provided by external
  7982. + object files (*crti.o and *crtn.o in this case).
  7983. +
  7984. + The SGI linker instead accepts several -init options. It will set DT_INIT
  7985. + to a linker-created function (placed in .init) that calls each of the -init
  7986. + functions in turn. If there is any user code in .init, this linker-created
  7987. + function will be placed after it. Note that such user code is not treated
  7988. + specially; it will only be called if the -init options arrange for it to
  7989. + be called.
  7990. +
  7991. + In theory, the SGI model should allow the crti, crtn and intermediate code
  7992. + to go in .init, just like it can with the GNU linker. However, doing this
  7993. + seems to confuse the linker and triggers an internal error:
  7994. +
  7995. + ld32: FATAL 2 : Internal: at ../../ld/mips_code.c mips_code_fixup()
  7996. + text section overflow!
  7997. +
  7998. + (seen with MIPSpro 7.30). We therefore put everything in a special
  7999. + .gcc_init section instead. */
  8000. +
  8001. + .section .gcc_init,"ax",@progbits
  8002. + .globl __gcc_init
  8003. +__gcc_init:
  8004. + daddiu $sp,$sp,-16
  8005. + sd $31,0($sp)
  8006. + sd $28,8($sp)
  8007. +
  8008. + .section .gcc_fini,"ax",@progbits
  8009. + .globl __gcc_fini
  8010. +__gcc_fini:
  8011. + daddiu $sp,$sp,-16
  8012. + sd $31,0($sp)
  8013. + sd $28,8($sp)
  8014. +
  8015. +/* This object will typically be included in the final link for both
  8016. + shared libraries and executable, and we need to hide the symbols to
  8017. + prevent possible symbol preemption warnings from the SGI linker. */
  8018. +.hidden __gcc_init
  8019. +.hidden __gcc_fini
  8020. +
  8021. diff -Naur gcc-9.5.0/libgcc/config/mips/irix-crtn.S gcc-9.5.0-irix/libgcc/config/mips/irix-crtn.S
  8022. --- gcc-9.5.0/libgcc/config/mips/irix-crtn.S 1969-12-31 19:00:00.000000000 +0000
  8023. +++ gcc-9.5.0-irix/libgcc/config/mips/irix-crtn.S 2025-02-13 08:55:07.789029600 +0000
  8024. @@ -0,0 +1,38 @@
  8025. +/* Copyright (C) 2004, 2011 Free Software Foundation, Inc.
  8026. +
  8027. +This file is part of GCC.
  8028. +
  8029. +GCC is free software; you can redistribute it and/or modify it under
  8030. +the terms of the GNU General Public License as published by the Free
  8031. +Software Foundation; either version 3, or (at your option) any later
  8032. +version.
  8033. +
  8034. +GCC is distributed in the hope that it will be useful, but WITHOUT ANY
  8035. +WARRANTY; without even the implied warranty of MERCHANTABILITY or
  8036. +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  8037. +for more details.
  8038. +
  8039. +Under Section 7 of GPL version 3, you are granted additional
  8040. +permissions described in the GCC Runtime Library Exception, version
  8041. +3.1, as published by the Free Software Foundation.
  8042. +
  8043. +You should have received a copy of the GNU General Public License and
  8044. +a copy of the GCC Runtime Library Exception along with this program;
  8045. +see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  8046. +<http://www.gnu.org/licenses/>. */
  8047. +
  8048. + .abicalls
  8049. + .set noreorder
  8050. + .set nomacro
  8051. +
  8052. + .section .gcc_init,"ax",@progbits
  8053. + ld $31,0($sp)
  8054. + ld $28,8($sp)
  8055. + jr $31
  8056. + daddiu $sp,$sp,16
  8057. +
  8058. + .section .gcc_fini,"ax",@progbits
  8059. + ld $31,0($sp)
  8060. + ld $28,8($sp)
  8061. + jr $31
  8062. + daddiu $sp,$sp,16
  8063. diff -Naur gcc-9.5.0/libgcc/config/mips/irix6-unwind.h gcc-9.5.0-irix/libgcc/config/mips/irix6-unwind.h
  8064. --- gcc-9.5.0/libgcc/config/mips/irix6-unwind.h 1969-12-31 19:00:00.000000000 +0000
  8065. +++ gcc-9.5.0-irix/libgcc/config/mips/irix6-unwind.h 2025-02-13 08:55:07.791402400 +0000
  8066. @@ -0,0 +1,180 @@
  8067. +/* DWARF2 EH unwinding support for MIPS IRIX 6.
  8068. + Copyright (C) 2011 Free Software Foundation, Inc.
  8069. +
  8070. +This file is part of GCC.
  8071. +
  8072. +GCC is free software; you can redistribute it and/or modify
  8073. +it under the terms of the GNU General Public License as published by
  8074. +the Free Software Foundation; either version 3, or (at your option)
  8075. +any later version.
  8076. +
  8077. +GCC is distributed in the hope that it will be useful,
  8078. +but WITHOUT ANY WARRANTY; without even the implied warranty of
  8079. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  8080. +GNU General Public License for more details.
  8081. +
  8082. +Under Section 7 of GPL version 3, you are granted additional
  8083. +permissions described in the GCC Runtime Library Exception, version
  8084. +3.1, as published by the Free Software Foundation.
  8085. +
  8086. +You should have received a copy of the GNU General Public License and
  8087. +a copy of the GCC Runtime Library Exception along with this program;
  8088. +see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  8089. +<http://www.gnu.org/licenses/>. */
  8090. +
  8091. +/* Do code reading to identify a signal frame, and set the frame
  8092. + state data appropriately. See unwind-dw2.c for the structs. */
  8093. +
  8094. +/* This code was developed-for and only tested-in limited ABI
  8095. + configurations. Characterize that. */
  8096. +
  8097. +#if defined (_ABIN32) || defined (_ABI64)
  8098. +#define SUPPORTED_ABI 1
  8099. +#else
  8100. +#define SUPPORTED_ABI 0
  8101. +#endif
  8102. +
  8103. +#include <signal.h>
  8104. +
  8105. +#define MD_FALLBACK_FRAME_STATE_FOR mips_fallback_frame_state
  8106. +
  8107. +/* Look at the code around RA to see if it matches a sighandler caller with a
  8108. + sigcontext_t * argument (SA_SIGINFO cleared). Return that pointer argument
  8109. + if it does match, or 0 otherwise. */
  8110. +
  8111. +static sigcontext_t *
  8112. +sigcontext_for (unsigned int *ra, void *cfa)
  8113. +{
  8114. + /* IRIX 6.5, mono-threaded application. We're lucky enough to be able
  8115. + to expect a short very sighandler specific sequence around.
  8116. +
  8117. + <_sigtramp+124>: li v0,1088 (SYS_sigreturn)
  8118. + <_sigtramp+128>: syscall */
  8119. +
  8120. + if ( ra[6] == 0x24020440
  8121. + && ra[7] == 0x0000000c)
  8122. + return (sigcontext_t *)(cfa + 0x30);
  8123. +
  8124. + /* IRIX 6.5 variants, multi-threaded application, pthreads. Nothing really
  8125. + sighandler specific handy, so match a fairly long constant sequence. */
  8126. +
  8127. +#if _MIPS_SIM == _ABIN32
  8128. + /*
  8129. + <sig_fixup_mask+40>: sd s0,0(sp)
  8130. + <sig_fixup_mask+44>: sll ra,a0,0x2
  8131. + <sig_fixup_mask+48>: addiu t9,t9,-28584/-28456/-28448
  8132. + <sig_fixup_mask+52>: lw s0,3804(at)
  8133. + <sig_fixup_mask+56>: addu t9,t9,ra
  8134. + <sig_fixup_mask+60>: lw t9,0(t9)
  8135. + <sig_fixup_mask+64>: ld at,3696(at)
  8136. + <sig_fixup_mask+68>: ld s2,88(s0)
  8137. + <sig_fixup_mask+72>: jalr t9
  8138. + <sig_fixup_mask+76>: sd at,88(s0) */
  8139. + if ( ra[-10] == 0xffb00000
  8140. + && ra[ -9] == 0x0004f880
  8141. + && (ra[-8] == 0x27399058
  8142. + || ra[-8] == 0x273990d8
  8143. + || ra[-8] == 0x273990e0)
  8144. + && ra[ -7] == 0x8c300edc
  8145. + && ra[ -6] == 0x033fc821
  8146. + && ra[ -5] == 0x8f390000
  8147. + && ra[ -4] == 0xdc210e70
  8148. + && ra[ -3] == 0xde120058
  8149. + && ra[ -2] == 0x0320f809
  8150. + && ra[ -1] == 0xfe010058)
  8151. +
  8152. +#elif _MIPS_SIM == _ABI64
  8153. + /*
  8154. + <sig_fixup_mask+44>: sd s0,0(sp)
  8155. + <sig_fixup_mask+48>: daddu t9,t9,ra
  8156. + <sig_fixup_mask+52>: dsll ra,a0,0x3
  8157. + <sig_fixup_mask+56>: ld s0,3880(at)
  8158. + <sig_fixup_mask+60>: daddu t9,t9,ra
  8159. + <sig_fixup_mask+64>: ld t9,0(t9)
  8160. + <sig_fixup_mask+68>: ld at,3696(at)
  8161. + <sig_fixup_mask+72>: ld s2,152(s0)
  8162. + <sig_fixup_mask+76>: jalr t9
  8163. + <sig_fixup_mask+80>: sd at,152(s0) */
  8164. + if ( ra[-10] == 0xffb00000
  8165. + && ra[ -9] == 0x033fc82d
  8166. + && ra[ -8] == 0x0004f8f8
  8167. + && ra[ -7] == 0xdc300f28
  8168. + && ra[ -6] == 0x033fc82d
  8169. + && ra[ -5] == 0xdf390000
  8170. + && ra[ -4] == 0xdc210e70
  8171. + && ra[ -3] == 0xde120098
  8172. + && ra[ -2] == 0x0320f809
  8173. + && ra[ -1] == 0xfe010098)
  8174. +#endif
  8175. + return (sigcontext_t *)(cfa + 0x60);
  8176. +
  8177. + return 0;
  8178. +}
  8179. +
  8180. +#define SIGCTX_GREG_ADDR(REGNO,SIGCTX) \
  8181. + ((void *) &(SIGCTX)->sc_regs[REGNO])
  8182. +
  8183. +#define SIGCTX_FPREG_ADDR(REGNO,SIGCTX) \
  8184. + ((void *) &(SIGCTX)->sc_fpregs[REGNO])
  8185. +
  8186. +static _Unwind_Reason_Code
  8187. +mips_fallback_frame_state (struct _Unwind_Context *context,
  8188. + _Unwind_FrameState *fs)
  8189. +{
  8190. + /* Return address and CFA of the frame we're attempting to unwind through,
  8191. + possibly a signal handler. */
  8192. + void *ctx_ra = (void *)context->ra;
  8193. + void *ctx_cfa = (void *)context->cfa;
  8194. +
  8195. + /* CFA of the intermediate abstract kernel frame between the interrupted
  8196. + code and the signal handler, if we're indeed unwinding through a signal
  8197. + handler. */
  8198. + void *k_cfa;
  8199. +
  8200. + /* Pointer to the sigcontext_t structure pushed by the kernel when we're
  8201. + unwinding through a signal handler setup with SA_SIGINFO cleared. */
  8202. + sigcontext_t *sigctx;
  8203. + int i;
  8204. +
  8205. + if (! SUPPORTED_ABI)
  8206. + return _URC_END_OF_STACK;
  8207. +
  8208. + sigctx = sigcontext_for (ctx_ra, ctx_cfa);
  8209. +
  8210. + if (sigctx == 0)
  8211. + return _URC_END_OF_STACK;
  8212. +
  8213. + /* The abstract kernel frame's CFA is extactly the stack pointer
  8214. + value at the interruption point. */
  8215. + k_cfa = *(void **)SIGCTX_GREG_ADDR (CTX_SP, sigctx);
  8216. +
  8217. + /* State the rules to compute the CFA we have the value of: use the
  8218. + previous CFA and offset by the difference between the two. See
  8219. + uw_update_context_1 for the supporting details. */
  8220. + fs->regs.cfa_how = CFA_REG_OFFSET;
  8221. + fs->regs.cfa_reg = __builtin_dwarf_sp_column ();
  8222. + fs->regs.cfa_offset = k_cfa - ctx_cfa;
  8223. +
  8224. + /* Fill the internal frame_state structure with information stating where
  8225. + each register of interest can be found from the CFA. */
  8226. + for (i = 0; i <= 31; i ++)
  8227. + {
  8228. + fs->regs.reg[i].how = REG_SAVED_OFFSET;
  8229. + fs->regs.reg[i].loc.offset = SIGCTX_GREG_ADDR (i, sigctx) - k_cfa;
  8230. + }
  8231. +
  8232. + for (i = 0; i <= 31; i ++)
  8233. + {
  8234. + fs->regs.reg[32+i].how = REG_SAVED_OFFSET;
  8235. + fs->regs.reg[32+i].loc.offset = SIGCTX_FPREG_ADDR (i, sigctx) - k_cfa;
  8236. + }
  8237. +
  8238. + /* State the rules to find the kernel's code "return address", which is the
  8239. + address of the active instruction when the signal was caught. */
  8240. + fs->retaddr_column = DWARF_FRAME_RETURN_COLUMN;
  8241. + fs->regs.reg[fs->retaddr_column].how = REG_SAVED_OFFSET;
  8242. + fs->regs.reg[fs->retaddr_column].loc.offset = (void *)&sigctx->sc_pc - k_cfa;
  8243. + fs->signal_frame = 1;
  8244. +
  8245. + return _URC_NO_REASON;
  8246. +}
  8247. diff -Naur gcc-9.5.0/libgcc/config/mips/sfp-machine.h gcc-9.5.0-irix/libgcc/config/mips/sfp-machine.h
  8248. --- gcc-9.5.0/libgcc/config/mips/sfp-machine.h 2022-05-27 03:21:12.899389000 +0000
  8249. +++ gcc-9.5.0-irix/libgcc/config/mips/sfp-machine.h 2025-02-13 08:55:07.799128800 +0000
  8250. @@ -22,6 +22,8 @@
  8251. see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  8252. <http://www.gnu.org/licenses/>. */
  8253.  
  8254. +#if !defined(__sgi)
  8255. +
  8256. #ifdef __mips64
  8257. #define _FP_W_TYPE_SIZE 64
  8258. #define _FP_W_TYPE unsigned long long
  8259. @@ -190,3 +192,5 @@
  8260. # define strong_alias(name, aliasname) _strong_alias(name, aliasname)
  8261. # define _strong_alias(name, aliasname) \
  8262. extern __typeof (name) aliasname __attribute__ ((alias (#name)));
  8263. +
  8264. +#endif /* !defined(__sgi) */
  8265. diff -Naur gcc-9.5.0/libgcc/config/mips/t-irix6 gcc-9.5.0-irix/libgcc/config/mips/t-irix6
  8266. --- gcc-9.5.0/libgcc/config/mips/t-irix6 1969-12-31 19:00:00.000000000 +0000
  8267. +++ gcc-9.5.0-irix/libgcc/config/mips/t-irix6 2025-02-13 08:55:07.800968000 +0000
  8268. @@ -0,0 +1,24 @@
  8269. +# Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005,
  8270. +# 2006, 2010, 2011 Free Software Foundation, Inc.
  8271. +#
  8272. +# This file is part of GCC.
  8273. +#
  8274. +# GCC is free software; you can redistribute it and/or modify
  8275. +# it under the terms of the GNU General Public License as published by
  8276. +# the Free Software Foundation; either version 3, or (at your option)
  8277. +# any later version.
  8278. +#
  8279. +# GCC is distributed in the hope that it will be useful,
  8280. +# but WITHOUT ANY WARRANTY; without even the implied warranty of
  8281. +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  8282. +# GNU General Public License for more details.
  8283. +#
  8284. +# You should have received a copy of the GNU General Public License
  8285. +# along with GCC; see the file COPYING3. If not see
  8286. +# <http://www.gnu.org/licenses/>.
  8287. +
  8288. +irix-crti.o: $(srcdir)/config/mips/irix-crti.S
  8289. + $(crt_compile) -c $<
  8290. +
  8291. +irix-crtn.o: $(srcdir)/config/mips/irix-crtn.S
  8292. + $(crt_compile) -c $<
  8293. diff -Naur gcc-9.5.0/libgcc/config/mips/t-mips-irixfp gcc-9.5.0-irix/libgcc/config/mips/t-mips-irixfp
  8294. --- gcc-9.5.0/libgcc/config/mips/t-mips-irixfp 1969-12-31 19:00:00.000000000 +0000
  8295. +++ gcc-9.5.0-irix/libgcc/config/mips/t-mips-irixfp 2025-02-13 08:55:07.802727200 +0000
  8296. @@ -0,0 +1,13 @@
  8297. +LIB2_SIDITI_CONV_FUNCS = yes
  8298. +
  8299. +FPBIT = true
  8300. +FPBIT_CFLAGS = -DQUIET_NAN_NEGATED
  8301. +DPBIT = true
  8302. +FPBIT_CFLAGS = -DQUIET_NAN_NEGATED
  8303. +
  8304. +ifeq ($(long_double_type_size),128)
  8305. +TPBIT = true
  8306. +TPBIT_CFLAGS = -DQUIET_NAN_NEGATED
  8307. +endif
  8308. +
  8309. +LIB2ADD_ST += $(srcdir)/config/mips/lib2funcs.c
  8310. diff -Naur gcc-9.5.0/libgcc/config/mips/t-slibgcc-irix gcc-9.5.0-irix/libgcc/config/mips/t-slibgcc-irix
  8311. --- gcc-9.5.0/libgcc/config/mips/t-slibgcc-irix 1969-12-31 19:00:00.000000000 +0000
  8312. +++ gcc-9.5.0-irix/libgcc/config/mips/t-slibgcc-irix 2025-02-13 08:55:07.810678400 +0000
  8313. @@ -0,0 +1,9 @@
  8314. +# Build a shared libgcc library with the SGI linker.
  8315. +
  8316. +SHLIB_LDFLAGS = -Wl,-soname,$(SHLIB_SONAME)
  8317. +#\
  8318. + #-Wl,-exports_file,$(SHLIB_MAP)
  8319. +
  8320. +SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk
  8321. +SHLIB_MAPFILES = libgcc-std.ver
  8322. +SHLIB_LC =
  8323. diff -Naur gcc-9.5.0/libgcc/config.host gcc-9.5.0-irix/libgcc/config.host
  8324. --- gcc-9.5.0/libgcc/config.host 2022-05-27 03:21:12.855388000 +0000
  8325. +++ gcc-9.5.0-irix/libgcc/config.host 2025-02-13 08:55:07.829696000 +0000
  8326. @@ -146,6 +146,15 @@
  8327. microblaze*-*-*)
  8328. cpu_type=microblaze
  8329. ;;
  8330. +mips-sgi-irix6.5*)
  8331. + # All MIPS targets provide a full set of FP routines.
  8332. + cpu_type=mips
  8333. + tmake_file="mips/t-mips-irixfp"
  8334. + # This doesn't work yet
  8335. + if test "${host_address}" = 64; then
  8336. + tmake_file="${tmake_file} mips/t-mips-irixfp64"
  8337. + fi
  8338. + ;;
  8339. mips*-*-*)
  8340. # All MIPS targets provide a full set of FP routines.
  8341. cpu_type=mips
  8342. @@ -914,6 +923,11 @@
  8343. tmake_file="${tmake_file} microblaze/t-microblaze t-fdpbit"
  8344. extra_parts="$extra_parts crtbeginS.o crtendS.o crtbeginT.o crti.o crtn.o"
  8345. ;;
  8346. +mips-sgi-irix6.5*)
  8347. + tmake_file="$tmake_file mips/t-irix6 t-crtfm mips/t-tpbit t-slibgcc mips/t-slibgcc-irix"
  8348. + extra_parts="crtbegin.o crtend.o crtfastmath.o irix-crti.o irix-crtn.o"
  8349. + md_unwind_header=mips/irix6-unwind.h
  8350. + ;;
  8351. microblaze*-*-rtems*)
  8352. tmake_file="${tmake_file} microblaze/t-microblaze t-fdpbit"
  8353. extra_parts="$extra_parts crtbeginS.o crtendS.o crtbeginT.o crti.o crtn.o"
  8354. diff -Naur gcc-9.5.0/libgcc/libgcov-driver-system.c gcc-9.5.0-irix/libgcc/libgcov-driver-system.c
  8355. --- gcc-9.5.0/libgcc/libgcov-driver-system.c 2022-05-27 03:21:12.915389000 +0000
  8356. +++ gcc-9.5.0-irix/libgcc/libgcov-driver-system.c 2025-02-13 08:55:07.832601600 +0000
  8357. @@ -158,7 +158,7 @@
  8358. switch (*p)
  8359. {
  8360. case 'p':
  8361. - sprintf (buffer, "%d", getpid ());
  8362. + sprintf (buffer, "%ld", getpid ());
  8363. replacement = buffer;
  8364. p++;
  8365. break;
  8366. diff -Naur gcc-9.5.0/libgomp/affinity-fmt.c gcc-9.5.0-irix/libgomp/affinity-fmt.c
  8367. --- gcc-9.5.0/libgomp/affinity-fmt.c 2022-05-27 03:21:13.143390000 +0000
  8368. +++ gcc-9.5.0-irix/libgomp/affinity-fmt.c 2025-02-13 11:39:06.266232000 +0000
  8369. @@ -383,15 +383,10 @@
  8370.  
  8371. if (sizeof (gomp_integral (handle)) == sizeof (unsigned long))
  8372. sprintf (buf, "0x%lx", (unsigned long) gomp_integral (handle));
  8373. -#if defined (HAVE_INTTYPES_H) && defined (PRIx64)
  8374. - else if (sizeof (gomp_integral (handle)) == sizeof (uint64_t))
  8375. - sprintf (buf, "0x%" PRIx64, (uint64_t) gomp_integral (handle));
  8376. -#else
  8377. else if (sizeof (gomp_integral (handle))
  8378. == sizeof (unsigned long long))
  8379. sprintf (buf, "0x%llx",
  8380. (unsigned long long) gomp_integral (handle));
  8381. -#endif
  8382. else
  8383. sprintf (buf, "0x%x", (unsigned int) gomp_integral (handle));
  8384. gomp_display_num (buffer, size, &ret, zero, right, sz, buf);
  8385. diff -Naur gcc-9.5.0/libgomp/config/posix/proc.c gcc-9.5.0-irix/libgomp/config/posix/proc.c
  8386. --- gcc-9.5.0/libgomp/config/posix/proc.c 2022-05-27 03:21:13.147390000 +0000
  8387. +++ gcc-9.5.0-irix/libgomp/config/posix/proc.c 2025-02-13 08:58:14.622660000 +0000
  8388. @@ -38,6 +38,9 @@
  8389. # endif
  8390. #endif
  8391.  
  8392. +#ifdef __sgi
  8393. +#define _SC_NPROCESSORS_ONLN _SC_NPROC_ONLN
  8394. +#endif
  8395.  
  8396. /* At startup, determine the default number of threads. It would seem
  8397. this should be related to the number of cpus online. */
  8398. diff -Naur gcc-9.5.0/libgomp/configure.tgt gcc-9.5.0-irix/libgomp/configure.tgt
  8399. --- gcc-9.5.0/libgomp/configure.tgt 2022-05-27 03:21:13.147390000 +0000
  8400. +++ gcc-9.5.0-irix/libgomp/configure.tgt 2025-02-13 08:55:07.839636000 +0000
  8401. @@ -145,6 +145,11 @@
  8402. XLDFLAGS="${XLDFLAGS} -lpthread"
  8403. ;;
  8404.  
  8405. + mips-sgi-irix6.5*)
  8406. + # Need to link with -lpthread so libgomp.so is self-contained.
  8407. + XLDFLAGS="${XLDFLAGS} -lpthread"
  8408. + ;;
  8409. +
  8410. *-*-aix*)
  8411. config_path="posix"
  8412. # Need to link with -lpthread so libgomp.so is self-contained.
  8413. diff -Naur gcc-9.5.0/libgomp/env.c gcc-9.5.0-irix/libgomp/env.c
  8414. --- gcc-9.5.0/libgomp/env.c 2022-05-27 03:21:13.147390000 +0000
  8415. +++ gcc-9.5.0-irix/libgomp/env.c 2025-02-13 11:40:44.889941600 +0000
  8416. @@ -1281,13 +1281,8 @@
  8417. {
  8418. fputs (" GOMP_CPU_AFFINITY = ''\n", stderr);
  8419. fprintf (stderr, " GOMP_STACKSIZE = '%lu'\n", stacksize);
  8420. -#ifdef HAVE_INTTYPES_H
  8421. - fprintf (stderr, " GOMP_SPINCOUNT = '%"PRIu64"'\n",
  8422. - (uint64_t) gomp_spin_count_var);
  8423. -#else
  8424. fprintf (stderr, " GOMP_SPINCOUNT = '%lu'\n",
  8425. (unsigned long) gomp_spin_count_var);
  8426. -#endif
  8427. }
  8428.  
  8429. fputs ("OPENMP DISPLAY ENVIRONMENT END\n", stderr);
  8430. diff -Naur gcc-9.5.0/libgomp/oacc-parallel.c gcc-9.5.0-irix/libgomp/oacc-parallel.c
  8431. --- gcc-9.5.0/libgomp/oacc-parallel.c 2022-05-27 03:21:13.151390000 +0000
  8432. +++ gcc-9.5.0-irix/libgomp/oacc-parallel.c 2025-02-13 11:41:29.937189600 +0000
  8433. @@ -140,13 +140,8 @@
  8434. unsigned dims[GOMP_DIM_MAX];
  8435. unsigned tag;
  8436.  
  8437. -#ifdef HAVE_INTTYPES_H
  8438. - gomp_debug (0, "%s: mapnum=%"PRIu64", hostaddrs=%p, size=%p, kinds=%p\n",
  8439. - __FUNCTION__, (uint64_t) mapnum, hostaddrs, sizes, kinds);
  8440. -#else
  8441. gomp_debug (0, "%s: mapnum=%lu, hostaddrs=%p, sizes=%p, kinds=%p\n",
  8442. __FUNCTION__, (unsigned long) mapnum, hostaddrs, sizes, kinds);
  8443. -#endif
  8444. goacc_lazy_initialize ();
  8445.  
  8446. thr = goacc_thread ();
  8447. @@ -297,13 +292,8 @@
  8448.  
  8449. struct target_mem_desc *tgt;
  8450.  
  8451. -#ifdef HAVE_INTTYPES_H
  8452. - gomp_debug (0, "%s: mapnum=%"PRIu64", hostaddrs=%p, size=%p, kinds=%p\n",
  8453. - __FUNCTION__, (uint64_t) mapnum, hostaddrs, sizes, kinds);
  8454. -#else
  8455. gomp_debug (0, "%s: mapnum=%lu, hostaddrs=%p, sizes=%p, kinds=%p\n",
  8456. __FUNCTION__, (unsigned long) mapnum, hostaddrs, sizes, kinds);
  8457. -#endif
  8458.  
  8459. goacc_lazy_initialize ();
  8460.  
  8461. diff -Naur gcc-9.5.0/libgomp/target.c gcc-9.5.0-irix/libgomp/target.c
  8462. --- gcc-9.5.0/libgomp/target.c 2022-05-27 03:21:13.155390000 +0000
  8463. +++ gcc-9.5.0-irix/libgomp/target.c 2025-02-13 11:38:48.329337600 +0000
  8464. @@ -932,16 +932,9 @@
  8465. was missing. */
  8466. size_t size = k->host_end - k->host_start;
  8467. gomp_mutex_unlock (&devicep->lock);
  8468. -#ifdef HAVE_INTTYPES_H
  8469. - gomp_fatal ("present clause: !acc_is_present (%p, "
  8470. - "%"PRIu64" (0x%"PRIx64"))",
  8471. - (void *) k->host_start,
  8472. - (uint64_t) size, (uint64_t) size);
  8473. -#else
  8474. gomp_fatal ("present clause: !acc_is_present (%p, "
  8475. "%lu (0x%lx))", (void *) k->host_start,
  8476. (unsigned long) size, (unsigned long) size);
  8477. -#endif
  8478. }
  8479. break;
  8480. case GOMP_MAP_FORCE_DEVICEPTR:
  8481. diff -Naur gcc-9.5.0/libstdc++-v3/acinclude.m4 gcc-9.5.0-irix/libstdc++-v3/acinclude.m4
  8482. --- gcc-9.5.0/libstdc++-v3/acinclude.m4 2022-05-27 03:21:13.311391000 +0000
  8483. +++ gcc-9.5.0-irix/libstdc++-v3/acinclude.m4 2025-02-13 08:55:08.101274400 +0000
  8484. @@ -276,7 +276,7 @@
  8485. AC_MSG_CHECKING([for ld that supports -Wl,-z,relro])
  8486. cxx_z_relo=`$LD -v --help 2>/dev/null | grep "z relro"`
  8487. if test -n "$cxx_z_relo"; then
  8488. - OPT_LDFLAGS="-Wl,-z,relro"
  8489. + OPT_LDFLAGS="-Wl,-z,relro $OPT_LDFLAGS"
  8490. ac_ld_relro=yes
  8491. fi
  8492. AC_MSG_RESULT($ac_ld_relro)
  8493. diff -Naur gcc-9.5.0/libstdc++-v3/config/os/irix/atomic_word.h gcc-9.5.0-irix/libstdc++-v3/config/os/irix/atomic_word.h
  8494. --- gcc-9.5.0/libstdc++-v3/config/os/irix/atomic_word.h 1969-12-31 19:00:00.000000000 +0000
  8495. +++ gcc-9.5.0-irix/libstdc++-v3/config/os/irix/atomic_word.h 2025-02-13 08:55:07.841889600 +0000
  8496. @@ -0,0 +1,35 @@
  8497. +// Low-level type for atomic operations -*- C++ -*-
  8498. +
  8499. +// Copyright (C) 2004, 2009, 2010 Free Software Foundation, Inc.
  8500. +//
  8501. +// This file is part of the GNU ISO C++ Library. This library is free
  8502. +// software; you can redistribute it and/or modify it under the
  8503. +// terms of the GNU General Public License as published by the
  8504. +// Free Software Foundation; either version 3, or (at your option)
  8505. +// any later version.
  8506. +
  8507. +// This library is distributed in the hope that it will be useful,
  8508. +// but WITHOUT ANY WARRANTY; without even the implied warranty of
  8509. +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  8510. +// GNU General Public License for more details.
  8511. +
  8512. +// Under Section 7 of GPL version 3, you are granted additional
  8513. +// permissions described in the GCC Runtime Library Exception, version
  8514. +// 3.1, as published by the Free Software Foundation.
  8515. +
  8516. +// You should have received a copy of the GNU General Public License and
  8517. +// a copy of the GCC Runtime Library Exception along with this program;
  8518. +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  8519. +// <http://www.gnu.org/licenses/>.
  8520. +
  8521. +/** @file bits/atomic_word.h
  8522. + * This is an internal header file, included by other library headers.
  8523. + * Do not attempt to use it directly. @headername{ext/atomicity.h}
  8524. + */
  8525. +
  8526. +#ifndef _GLIBCXX_ATOMIC_WORD_H
  8527. +#define _GLIBCXX_ATOMIC_WORD_H 1
  8528. +
  8529. +typedef long _Atomic_word;
  8530. +
  8531. +#endif
  8532. diff -Naur gcc-9.5.0/libstdc++-v3/config/os/irix/atomicity.h gcc-9.5.0-irix/libstdc++-v3/config/os/irix/atomicity.h
  8533. --- gcc-9.5.0/libstdc++-v3/config/os/irix/atomicity.h 1969-12-31 19:00:00.000000000 +0000
  8534. +++ gcc-9.5.0-irix/libstdc++-v3/config/os/irix/atomicity.h 2025-02-13 08:55:07.843772800 +0000
  8535. @@ -0,0 +1,41 @@
  8536. +// Low-level functions for atomic operations: IRIX version -*- C++ -*-
  8537. +
  8538. +// Copyright (C) 2001, 2004, 2005, 2009 Free Software Foundation, Inc.
  8539. +//
  8540. +// This file is part of the GNU ISO C++ Library. This library is free
  8541. +// software; you can redistribute it and/or modify it under the
  8542. +// terms of the GNU General Public License as published by the
  8543. +// Free Software Foundation; either version 3, or (at your option)
  8544. +// any later version.
  8545. +
  8546. +// This library is distributed in the hope that it will be useful,
  8547. +// but WITHOUT ANY WARRANTY; without even the implied warranty of
  8548. +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  8549. +// GNU General Public License for more details.
  8550. +
  8551. +// Under Section 7 of GPL version 3, you are granted additional
  8552. +// permissions described in the GCC Runtime Library Exception, version
  8553. +// 3.1, as published by the Free Software Foundation.
  8554. +
  8555. +// You should have received a copy of the GNU General Public License and
  8556. +// a copy of the GCC Runtime Library Exception along with this program;
  8557. +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  8558. +// <http://www.gnu.org/licenses/>.
  8559. +
  8560. +#include <mutex.h>
  8561. +#include <ext/atomicity.h>
  8562. +
  8563. +namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
  8564. +{
  8565. +_GLIBCXX_BEGIN_NAMESPACE_VERSION
  8566. +
  8567. + _Atomic_word
  8568. + __exchange_and_add(volatile _Atomic_word* __mem, int __val) throw ()
  8569. + { return (_Atomic_word) test_then_add((unsigned long*) const_cast<_Atomic_word*>(__mem), __val); }
  8570. +
  8571. + void
  8572. + __atomic_add(volatile _Atomic_word* __mem, int __val) throw ()
  8573. + { __exchange_and_add(__mem, __val); }
  8574. +
  8575. +_GLIBCXX_END_NAMESPACE_VERSION
  8576. +} // namespace
  8577. diff -Naur gcc-9.5.0/libstdc++-v3/config/os/irix/irix6.5/ctype_base.h gcc-9.5.0-irix/libstdc++-v3/config/os/irix/irix6.5/ctype_base.h
  8578. --- gcc-9.5.0/libstdc++-v3/config/os/irix/irix6.5/ctype_base.h 1969-12-31 19:00:00.000000000 +0000
  8579. +++ gcc-9.5.0-irix/libstdc++-v3/config/os/irix/irix6.5/ctype_base.h 2025-02-13 08:55:07.845839200 +0000
  8580. @@ -0,0 +1,65 @@
  8581. +// Locale support -*- C++ -*-
  8582. +
  8583. +// Copyright (C) 1997, 1998, 1999, 2003, 2009, 2010
  8584. +// Free Software Foundation, Inc.
  8585. +//
  8586. +// This file is part of the GNU ISO C++ Library. This library is free
  8587. +// software; you can redistribute it and/or modify it under the
  8588. +// terms of the GNU General Public License as published by the
  8589. +// Free Software Foundation; either version 3, or (at your option)
  8590. +// any later version.
  8591. +
  8592. +// This library is distributed in the hope that it will be useful,
  8593. +// but WITHOUT ANY WARRANTY; without even the implied warranty of
  8594. +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  8595. +// GNU General Public License for more details.
  8596. +
  8597. +// Under Section 7 of GPL version 3, you are granted additional
  8598. +// permissions described in the GCC Runtime Library Exception, version
  8599. +// 3.1, as published by the Free Software Foundation.
  8600. +
  8601. +// You should have received a copy of the GNU General Public License and
  8602. +// a copy of the GCC Runtime Library Exception along with this program;
  8603. +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  8604. +// <http://www.gnu.org/licenses/>.
  8605. +
  8606. +/** @file bits/ctype_base.h
  8607. + * This is an internal header file, included by other library headers.
  8608. + * Do not attempt to use it directly. @headername{locale}
  8609. + */
  8610. +
  8611. +//
  8612. +// ISO C++ 14882: 22.1 Locales
  8613. +//
  8614. +
  8615. +// Information as gleaned from /usr/include/ctype.h on irix 6.5
  8616. +
  8617. +namespace std _GLIBCXX_VISIBILITY(default)
  8618. +{
  8619. +_GLIBCXX_BEGIN_NAMESPACE_VERSION
  8620. +
  8621. + /// @brief Base class for ctype.
  8622. + struct ctype_base
  8623. + {
  8624. + // Non-standard typedefs.
  8625. + typedef int* __to_type;
  8626. +
  8627. + // NB: Offsets into ctype<char>::_M_table force a particular size
  8628. + // on the mask type. Because of this, we don't use an enum.
  8629. + typedef unsigned int mask;
  8630. + static const mask upper = _ISupper;
  8631. + static const mask lower = _ISlower;
  8632. + static const mask alpha = _ISalpha;
  8633. + static const mask digit = _ISdigit;
  8634. + static const mask xdigit = _ISxdigit;
  8635. + static const mask space = _ISspace;
  8636. + static const mask print = _ISprint;
  8637. + static const mask graph = _ISalpha | _ISdigit | _ISpunct;
  8638. + static const mask cntrl = _IScntrl;
  8639. + static const mask punct = _ISpunct;
  8640. + static const mask alnum = _ISalpha | _ISdigit;
  8641. + static const mask blank = _ISblank;
  8642. + };
  8643. +
  8644. +_GLIBCXX_END_NAMESPACE_VERSION
  8645. +} // namespace
  8646. diff -Naur gcc-9.5.0/libstdc++-v3/config/os/irix/irix6.5/ctype_configure_char.cc gcc-9.5.0-irix/libstdc++-v3/config/os/irix/irix6.5/ctype_configure_char.cc
  8647. --- gcc-9.5.0/libstdc++-v3/config/os/irix/irix6.5/ctype_configure_char.cc 1969-12-31 19:00:00.000000000 +0000
  8648. +++ gcc-9.5.0-irix/libstdc++-v3/config/os/irix/irix6.5/ctype_configure_char.cc 2025-02-13 08:55:07.847931200 +0000
  8649. @@ -0,0 +1,101 @@
  8650. +// Locale support -*- C++ -*-
  8651. +
  8652. +// Copyright (C) 2011 Free Software Foundation, Inc.
  8653. +//
  8654. +// This file is part of the GNU ISO C++ Library. This library is free
  8655. +// software; you can redistribute it and/or modify it under the
  8656. +// terms of the GNU General Public License as published by the
  8657. +// Free Software Foundation; either version 3, or (at your option)
  8658. +// any later version.
  8659. +
  8660. +// This library is distributed in the hope that it will be useful,
  8661. +// but WITHOUT ANY WARRANTY; without even the implied warranty of
  8662. +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  8663. +// GNU General Public License for more details.
  8664. +
  8665. +// Under Section 7 of GPL version 3, you are granted additional
  8666. +// permissions described in the GCC Runtime Library Exception, version
  8667. +// 3.1, as published by the Free Software Foundation.
  8668. +
  8669. +// You should have received a copy of the GNU General Public License and
  8670. +// a copy of the GCC Runtime Library Exception along with this program;
  8671. +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  8672. +// <http://www.gnu.org/licenses/>.
  8673. +
  8674. +/** @file ctype_configure_char.cc */
  8675. +
  8676. +//
  8677. +// ISO C++ 14882: 22.1 Locales
  8678. +//
  8679. +
  8680. +#include <locale>
  8681. +#include <cstdlib>
  8682. +#include <cstring>
  8683. +
  8684. +namespace std _GLIBCXX_VISIBILITY(default)
  8685. +{
  8686. +_GLIBCXX_BEGIN_NAMESPACE_VERSION
  8687. +
  8688. +// Information as gleaned from /usr/include/ctype.h
  8689. +
  8690. + const ctype_base::mask*
  8691. + ctype<char>::classic_table() throw()
  8692. + { return 0; }
  8693. +
  8694. + ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
  8695. + size_t __refs)
  8696. + : facet(__refs), _M_del(__table != 0 && __del),
  8697. + _M_toupper(NULL), _M_tolower(NULL),
  8698. + _M_table(!__table ?
  8699. + (const mask*) (__libc_attr._ctype_tbl->_class + 1) : __table)
  8700. + {
  8701. + memset(_M_widen, 0, sizeof(_M_widen));
  8702. + _M_widen_ok = 0;
  8703. + memset(_M_narrow, 0, sizeof(_M_narrow));
  8704. + _M_narrow_ok = 0;
  8705. + }
  8706. +
  8707. + ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
  8708. + : facet(__refs), _M_del(__table != 0 && __del),
  8709. + _M_toupper(NULL), _M_tolower(NULL),
  8710. + _M_table(!__table ?
  8711. + (const mask*) (__libc_attr._ctype_tbl->_class + 1) : __table)
  8712. + {
  8713. + memset(_M_widen, 0, sizeof(_M_widen));
  8714. + _M_widen_ok = 0;
  8715. + memset(_M_narrow, 0, sizeof(_M_narrow));
  8716. + _M_narrow_ok = 0;
  8717. + }
  8718. +
  8719. + char
  8720. + ctype<char>::do_toupper(char __c) const
  8721. + { return _toupper(__c); }
  8722. +
  8723. + const char*
  8724. + ctype<char>::do_toupper(char* __low, const char* __high) const
  8725. + {
  8726. + while (__low < __high)
  8727. + {
  8728. + *__low = do_toupper(*__low);
  8729. + ++__low;
  8730. + }
  8731. + return __high;
  8732. + }
  8733. +
  8734. + char
  8735. + ctype<char>::do_tolower(char __c) const
  8736. + { return _tolower(__c); }
  8737. +
  8738. + const char*
  8739. + ctype<char>::do_tolower(char* __low, const char* __high) const
  8740. + {
  8741. + while (__low < __high)
  8742. + {
  8743. + *__low = do_tolower(*__low);
  8744. + ++__low;
  8745. + }
  8746. + return __high;
  8747. + }
  8748. +
  8749. +_GLIBCXX_END_NAMESPACE_VERSION
  8750. +} // namespace
  8751. diff -Naur gcc-9.5.0/libstdc++-v3/config/os/irix/irix6.5/ctype_inline.h gcc-9.5.0-irix/libstdc++-v3/config/os/irix/irix6.5/ctype_inline.h
  8752. --- gcc-9.5.0/libstdc++-v3/config/os/irix/irix6.5/ctype_inline.h 1969-12-31 19:00:00.000000000 +0000
  8753. +++ gcc-9.5.0-irix/libstdc++-v3/config/os/irix/irix6.5/ctype_inline.h 2025-02-13 08:55:07.849861600 +0000
  8754. @@ -0,0 +1,74 @@
  8755. +// Locale support -*- C++ -*-
  8756. +
  8757. +// Copyright (C) 2000, 2002, 2009, 2010 Free Software Foundation, Inc.
  8758. +//
  8759. +// This file is part of the GNU ISO C++ Library. This library is free
  8760. +// software; you can redistribute it and/or modify it under the
  8761. +// terms of the GNU General Public License as published by the
  8762. +// Free Software Foundation; either version 3, or (at your option)
  8763. +// any later version.
  8764. +
  8765. +// This library is distributed in the hope that it will be useful,
  8766. +// but WITHOUT ANY WARRANTY; without even the implied warranty of
  8767. +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  8768. +// GNU General Public License for more details.
  8769. +
  8770. +// Under Section 7 of GPL version 3, you are granted additional
  8771. +// permissions described in the GCC Runtime Library Exception, version
  8772. +// 3.1, as published by the Free Software Foundation.
  8773. +
  8774. +// You should have received a copy of the GNU General Public License and
  8775. +// a copy of the GCC Runtime Library Exception along with this program;
  8776. +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  8777. +// <http://www.gnu.org/licenses/>.
  8778. +
  8779. +/** @file bits/ctype_inline.h
  8780. + * This is an internal header file, included by other library headers.
  8781. + * Do not attempt to use it directly. @headername{locale}
  8782. + */
  8783. +
  8784. +//
  8785. +// ISO C++ 14882: 22.1 Locales
  8786. +//
  8787. +
  8788. +// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
  8789. +// functions go in ctype.cc
  8790. +
  8791. +namespace std _GLIBCXX_VISIBILITY(default)
  8792. +{
  8793. +_GLIBCXX_BEGIN_NAMESPACE_VERSION
  8794. +
  8795. + bool
  8796. + ctype<char>::
  8797. + is(mask __m, char __c) const
  8798. + { return (_M_table)[static_cast<unsigned char>(__c)] & __m; }
  8799. +
  8800. + const char*
  8801. + ctype<char>::
  8802. + is(const char* __low, const char* __high, mask* __vec) const
  8803. + {
  8804. + while (__low < __high)
  8805. + *__vec++ = (_M_table)[static_cast<unsigned char>(*__low++)];
  8806. + return __high;
  8807. + }
  8808. +
  8809. + const char*
  8810. + ctype<char>::
  8811. + scan_is(mask __m, const char* __low, const char* __high) const
  8812. + {
  8813. + while (__low < __high && ! this->is(__m, *__low))
  8814. + ++__low;
  8815. + return __low;
  8816. + }
  8817. +
  8818. + const char*
  8819. + ctype<char>::
  8820. + scan_not(mask __m, const char* __low, const char* __high) const
  8821. + {
  8822. + while (__low < __high && this->is(__m, *__low))
  8823. + ++__low;
  8824. + return __low;
  8825. + }
  8826. +
  8827. +_GLIBCXX_END_NAMESPACE_VERSION
  8828. +} // namespace
  8829. diff -Naur gcc-9.5.0/libstdc++-v3/config/os/irix/irix6.5/os_defines.h gcc-9.5.0-irix/libstdc++-v3/config/os/irix/irix6.5/os_defines.h
  8830. --- gcc-9.5.0/libstdc++-v3/config/os/irix/irix6.5/os_defines.h 1969-12-31 19:00:00.000000000 +0000
  8831. +++ gcc-9.5.0-irix/libstdc++-v3/config/os/irix/irix6.5/os_defines.h 2025-02-13 08:55:07.855935200 +0000
  8832. @@ -0,0 +1,60 @@
  8833. +// Specific definitions for IRIX -*- C++ -*-
  8834. +
  8835. +// Copyright (C) 2000, 2002, 2009, 2010 Free Software Foundation, Inc.
  8836. +//
  8837. +// This file is part of the GNU ISO C++ Library. This library is free
  8838. +// software; you can redistribute it and/or modify it under the
  8839. +// terms of the GNU General Public License as published by the
  8840. +// Free Software Foundation; either version 3, or (at your option)
  8841. +// any later version.
  8842. +
  8843. +// This library is distributed in the hope that it will be useful,
  8844. +// but WITHOUT ANY WARRANTY; without even the implied warranty of
  8845. +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  8846. +// GNU General Public License for more details.
  8847. +
  8848. +// Under Section 7 of GPL version 3, you are granted additional
  8849. +// permissions described in the GCC Runtime Library Exception, version
  8850. +// 3.1, as published by the Free Software Foundation.
  8851. +
  8852. +// You should have received a copy of the GNU General Public License and
  8853. +// a copy of the GCC Runtime Library Exception along with this program;
  8854. +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  8855. +// <http://www.gnu.org/licenses/>.
  8856. +
  8857. +/** @file bits/os_defines.h
  8858. + * This is an internal header file, included by other library headers.
  8859. + * Do not attempt to use it directly. @headername{iosfwd}
  8860. + */
  8861. +
  8862. +#ifndef _GLIBCXX_OS_DEFINES
  8863. +#define _GLIBCXX_OS_DEFINES 1
  8864. +
  8865. +// System-specific #define, typedefs, corrections, etc, go here. This
  8866. +// file will come before all others.
  8867. +
  8868. +#define _GLIBCXX_USE_C99 1
  8869. +#define _GLIBCXX_USE_C99_STDIO 1
  8870. +#define _GLIBCXX_USE_C99_STDLIB 1
  8871. +#define _GLIBCXX_USE_C99_WCHAR 1
  8872. +#define _GLIBCXX_USE_WCHAR_T 1
  8873. +
  8874. +// We need large file support. There are two ways to turn it on: by
  8875. +// defining either _LARGEFILE64_SOURCE or _SGI_SOURCE. However, it
  8876. +// does not actually work to define only the former, as then
  8877. +// <sys/stat.h> is invalid: `st_blocks' is defined to be a macro, but
  8878. +// then used as a field name. So, we have to turn on _SGI_SOURCE.
  8879. +// That only works if _POSIX_SOURCE is turned off, so we have to
  8880. +// explicitly turn it off. (Some of the libio C files explicitly try
  8881. +// to turn it on.) _SGI_SOURCE is actually turned on implicitly via
  8882. +// the command-line.
  8883. +#undef _POSIX_SOURCE
  8884. +
  8885. +// GCC does not use thunks on IRIX.
  8886. +#define _G_USING_THUNKS 0
  8887. +
  8888. +// FINOREAD takes an "off_t *" as argument.
  8889. +#define _GLIBCXX_FIONREAD_TAKES_OFF_T
  8890. +
  8891. +#endif
  8892. +
  8893. diff -Naur gcc-9.5.0/libstdc++-v3/configure gcc-9.5.0-irix/libstdc++-v3/configure
  8894. --- gcc-9.5.0/libstdc++-v3/configure 2022-05-27 03:21:13.335391000 +0000
  8895. +++ gcc-9.5.0-irix/libstdc++-v3/configure 2025-02-13 08:55:08.084661600 +0000
  8896. @@ -21981,7 +21981,7 @@
  8897. $as_echo_n "checking for ld that supports -Wl,-z,relro... " >&6; }
  8898. cxx_z_relo=`$LD -v --help 2>/dev/null | grep "z relro"`
  8899. if test -n "$cxx_z_relo"; then
  8900. - OPT_LDFLAGS="-Wl,-z,relro"
  8901. + OPT_LDFLAGS="-Wl,-z,relro $OPT_LDFLAGS"
  8902. ac_ld_relro=yes
  8903. fi
  8904. { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ld_relro" >&5
  8905. diff -Naur gcc-9.5.0/libstdc++-v3/configure.host gcc-9.5.0-irix/libstdc++-v3/configure.host
  8906. --- gcc-9.5.0/libstdc++-v3/configure.host 2022-05-27 03:21:13.335391000 +0000
  8907. +++ gcc-9.5.0-irix/libstdc++-v3/configure.host 2025-02-13 08:55:07.858649600 +0000
  8908. @@ -276,6 +276,15 @@
  8909. hpux*)
  8910. os_include_dir="os/hpux"
  8911. ;;
  8912. + irix6.5*)
  8913. + os_include_dir="os/irix/irix6.5"
  8914. + atomicity_dir=os/irix
  8915. + atomic_word_dir=os/irix
  8916. + # libstdc++.so relies on emutls on IRIX, which only works with the
  8917. + # real functions implemented in libpthread.so, not with the stubs in
  8918. + # libc, so always pass -lpthread.
  8919. + OPT_LDFLAGS="${OPT_LDFLAGS} -Wl,--no-as-needed -lpthread -Wl,--as-needed"
  8920. + ;;
  8921. mingw32*)
  8922. case "$host" in
  8923. *-w64-*)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement