0021-gentypes-genmodes-Do-not-use-__LINE__-for-maintainin.patch 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. From 4efc42b99c96b026f560b0918de7e237ac3dc8d1 Mon Sep 17 00:00:00 2001
  2. From: Richard Purdie <richard.purdie@linuxfoundation.org>
  3. Date: Tue, 10 Mar 2020 08:26:53 -0700
  4. Subject: [PATCH] gentypes/genmodes: Do not use __LINE__ for maintaining
  5. reproducibility
  6. Inserting line numbers into generated code means its not always reproducible wth
  7. differing versions of host gcc. Void the issue by not adding these.
  8. Upstream-Status: Inappropriate [OE Reproducibility specific]
  9. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
  10. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  11. ---
  12. gcc/gengtype.cc | 6 +++---
  13. gcc/genmodes.cc | 32 ++++++++++++++++----------------
  14. 2 files changed, 19 insertions(+), 19 deletions(-)
  15. diff --git a/gcc/gengtype.cc b/gcc/gengtype.cc
  16. index 386ae1b0506..9762e914296 100644
  17. --- a/gcc/gengtype.cc
  18. +++ b/gcc/gengtype.cc
  19. @@ -1006,7 +1006,7 @@ create_field_at (pair_p next, type_p type, const char *name, options_p opt,
  20. /* Create a fake field with the given type and name. NEXT is the next
  21. field in the chain. */
  22. #define create_field(next,type,name) \
  23. - create_field_all (next,type,name, 0, this_file, __LINE__)
  24. + create_field_all (next,type,name, 0, this_file, 0)
  25. /* Like create_field, but the field is only valid when condition COND
  26. is true. */
  27. @@ -1039,7 +1039,7 @@ create_optional_field_ (pair_p next, type_p type, const char *name,
  28. }
  29. #define create_optional_field(next,type,name,cond) \
  30. - create_optional_field_(next,type,name,cond,__LINE__)
  31. + create_optional_field_(next,type,name,cond,0)
  32. /* Reverse a linked list of 'struct pair's in place. */
  33. pair_p
  34. @@ -5238,7 +5238,7 @@ main (int argc, char **argv)
  35. /* These types are set up with #define or else outside of where
  36. we can see them. We should initialize them before calling
  37. read_input_list. */
  38. -#define POS_HERE(Call) do { pos.file = this_file; pos.line = __LINE__; \
  39. +#define POS_HERE(Call) do { pos.file = this_file; pos.line = 0; \
  40. Call;} while (0)
  41. POS_HERE (do_scalar_typedef ("CUMULATIVE_ARGS", &pos));
  42. POS_HERE (do_scalar_typedef ("REAL_VALUE_TYPE", &pos));
  43. diff --git a/gcc/genmodes.cc b/gcc/genmodes.cc
  44. index 59850bb070a..e187f8542a1 100644
  45. --- a/gcc/genmodes.cc
  46. +++ b/gcc/genmodes.cc
  47. @@ -440,7 +440,7 @@ complete_all_modes (void)
  48. }
  49. /* For each mode in class CLASS, construct a corresponding complex mode. */
  50. -#define COMPLEX_MODES(C) make_complex_modes (MODE_##C, __FILE__, __LINE__)
  51. +#define COMPLEX_MODES(C) make_complex_modes (MODE_##C, __FILE__, 0)
  52. static void
  53. make_complex_modes (enum mode_class cl,
  54. const char *file, unsigned int line)
  55. @@ -499,7 +499,7 @@ make_complex_modes (enum mode_class cl,
  56. having as many components as necessary. ORDER is the sorting order
  57. of the mode, with smaller numbers indicating a higher priority. */
  58. #define VECTOR_MODES_WITH_PREFIX(PREFIX, C, W, ORDER) \
  59. - make_vector_modes (MODE_##C, #PREFIX, W, ORDER, __FILE__, __LINE__)
  60. + make_vector_modes (MODE_##C, #PREFIX, W, ORDER, __FILE__, 0)
  61. #define VECTOR_MODES(C, W) VECTOR_MODES_WITH_PREFIX (V, C, W, 0)
  62. static void ATTRIBUTE_UNUSED
  63. make_vector_modes (enum mode_class cl, const char *prefix, unsigned int width,
  64. @@ -552,7 +552,7 @@ make_vector_modes (enum mode_class cl, const char *prefix, unsigned int width,
  65. BYTESIZE bytes in total. */
  66. #define VECTOR_BOOL_MODE(NAME, COUNT, COMPONENT, BYTESIZE) \
  67. make_vector_bool_mode (#NAME, COUNT, #COMPONENT, BYTESIZE, \
  68. - __FILE__, __LINE__)
  69. + __FILE__, 0)
  70. static void ATTRIBUTE_UNUSED
  71. make_vector_bool_mode (const char *name, unsigned int count,
  72. const char *component, unsigned int bytesize,
  73. @@ -574,7 +574,7 @@ make_vector_bool_mode (const char *name, unsigned int count,
  74. /* Input. */
  75. #define _SPECIAL_MODE(C, N) \
  76. - make_special_mode (MODE_##C, #N, __FILE__, __LINE__)
  77. + make_special_mode (MODE_##C, #N, __FILE__, 0)
  78. #define RANDOM_MODE(N) _SPECIAL_MODE (RANDOM, N)
  79. #define CC_MODE(N) _SPECIAL_MODE (CC, N)
  80. @@ -587,7 +587,7 @@ make_special_mode (enum mode_class cl, const char *name,
  81. #define INT_MODE(N, Y) FRACTIONAL_INT_MODE (N, -1U, Y)
  82. #define FRACTIONAL_INT_MODE(N, B, Y) \
  83. - make_int_mode (#N, B, Y, __FILE__, __LINE__)
  84. + make_int_mode (#N, B, Y, __FILE__, 0)
  85. static void
  86. make_int_mode (const char *name,
  87. @@ -628,16 +628,16 @@ make_opaque_mode (const char *name,
  88. }
  89. #define FRACT_MODE(N, Y, F) \
  90. - make_fixed_point_mode (MODE_FRACT, #N, Y, 0, F, __FILE__, __LINE__)
  91. + make_fixed_point_mode (MODE_FRACT, #N, Y, 0, F, __FILE__, 0)
  92. #define UFRACT_MODE(N, Y, F) \
  93. - make_fixed_point_mode (MODE_UFRACT, #N, Y, 0, F, __FILE__, __LINE__)
  94. + make_fixed_point_mode (MODE_UFRACT, #N, Y, 0, F, __FILE__, 0)
  95. #define ACCUM_MODE(N, Y, I, F) \
  96. - make_fixed_point_mode (MODE_ACCUM, #N, Y, I, F, __FILE__, __LINE__)
  97. + make_fixed_point_mode (MODE_ACCUM, #N, Y, I, F, __FILE__, 0)
  98. #define UACCUM_MODE(N, Y, I, F) \
  99. - make_fixed_point_mode (MODE_UACCUM, #N, Y, I, F, __FILE__, __LINE__)
  100. + make_fixed_point_mode (MODE_UACCUM, #N, Y, I, F, __FILE__, 0)
  101. /* Create a fixed-point mode by setting CL, NAME, BYTESIZE, IBIT, FBIT,
  102. FILE, and LINE. */
  103. @@ -658,7 +658,7 @@ make_fixed_point_mode (enum mode_class cl,
  104. #define FLOAT_MODE(N, Y, F) FRACTIONAL_FLOAT_MODE (N, -1U, Y, F)
  105. #define FRACTIONAL_FLOAT_MODE(N, B, Y, F) \
  106. - make_float_mode (#N, B, Y, #F, __FILE__, __LINE__)
  107. + make_float_mode (#N, B, Y, #F, __FILE__, 0)
  108. static void
  109. make_float_mode (const char *name,
  110. @@ -675,7 +675,7 @@ make_float_mode (const char *name,
  111. #define DECIMAL_FLOAT_MODE(N, Y, F) \
  112. FRACTIONAL_DECIMAL_FLOAT_MODE (N, -1U, Y, F)
  113. #define FRACTIONAL_DECIMAL_FLOAT_MODE(N, B, Y, F) \
  114. - make_decimal_float_mode (#N, B, Y, #F, __FILE__, __LINE__)
  115. + make_decimal_float_mode (#N, B, Y, #F, __FILE__, 0)
  116. static void
  117. make_decimal_float_mode (const char *name,
  118. @@ -690,7 +690,7 @@ make_decimal_float_mode (const char *name,
  119. }
  120. #define RESET_FLOAT_FORMAT(N, F) \
  121. - reset_float_format (#N, #F, __FILE__, __LINE__)
  122. + reset_float_format (#N, #F, __FILE__, 0)
  123. static void ATTRIBUTE_UNUSED
  124. reset_float_format (const char *name, const char *format,
  125. const char *file, unsigned int line)
  126. @@ -711,7 +711,7 @@ reset_float_format (const char *name, const char *format,
  127. /* __intN support. */
  128. #define INT_N(M,PREC) \
  129. - make_int_n (#M, PREC, __FILE__, __LINE__)
  130. + make_int_n (#M, PREC, __FILE__, 0)
  131. static void ATTRIBUTE_UNUSED
  132. make_int_n (const char *m, int bitsize,
  133. const char *file, unsigned int line)
  134. @@ -740,7 +740,7 @@ make_int_n (const char *m, int bitsize,
  135. /* Partial integer modes are specified by relation to a full integer
  136. mode. */
  137. #define PARTIAL_INT_MODE(M,PREC,NAME) \
  138. - make_partial_integer_mode (#M, #NAME, PREC, __FILE__, __LINE__)
  139. + make_partial_integer_mode (#M, #NAME, PREC, __FILE__, 0)
  140. static void ATTRIBUTE_UNUSED
  141. make_partial_integer_mode (const char *base, const char *name,
  142. unsigned int precision,
  143. @@ -767,7 +767,7 @@ make_partial_integer_mode (const char *base, const char *name,
  144. /* A single vector mode can be specified by naming its component
  145. mode and the number of components. */
  146. #define VECTOR_MODE_WITH_PREFIX(PREFIX, C, M, N, ORDER) \
  147. - make_vector_mode (MODE_##C, #PREFIX, #M, N, ORDER, __FILE__, __LINE__);
  148. + make_vector_mode (MODE_##C, #PREFIX, #M, N, ORDER, __FILE__, 0);
  149. #define VECTOR_MODE(C, M, N) VECTOR_MODE_WITH_PREFIX(V, C, M, N, 0);
  150. static void ATTRIBUTE_UNUSED
  151. make_vector_mode (enum mode_class bclass,
  152. @@ -814,7 +814,7 @@ make_vector_mode (enum mode_class bclass,
  153. /* Adjustability. */
  154. #define _ADD_ADJUST(A, M, X, C1, C2) \
  155. - new_adjust (#M, &adj_##A, #A, #X, MODE_##C1, MODE_##C2, __FILE__, __LINE__)
  156. + new_adjust (#M, &adj_##A, #A, #X, MODE_##C1, MODE_##C2, __FILE__, 0)
  157. #define ADJUST_NUNITS(M, X) _ADD_ADJUST (nunits, M, X, RANDOM, RANDOM)
  158. #define ADJUST_BYTESIZE(M, X) _ADD_ADJUST (bytesize, M, X, RANDOM, RANDOM)