Bug#581240: [gdc-4.3] Calculation of MD5 sums seriously broken
On 13 May 2010 09:46, Iain Buclaw
<ibuclaw@ubuntu.com> wrote:
I'm happy to say this is resolved (for me). Attaching updated gdc-4.3.dpatch which addresses the issue.
And a patch against debian's gccsvn ( for the lazy ;).
--
Iain Buclaw
*(p < e ? p++ : p) = (c & 0x0f) + '0';
Index: debian/patches/gdc-4.3.dpatch
===================================================================
--- debian/patches/gdc-4.3.dpatch (revision 4407)
+++ debian/patches/gdc-4.3.dpatch (working copy)
@@ -26,11 +26,97 @@
esac
exit 0
-*** gcc-orig/config/i386/i386.c 2008-05-21 04:54:15.000000000 -0400
---- gcc/config/i386/i386.c 2008-07-24 10:45:17.000000000 -0400
+
+diff -cr gcc.orig/cgraph.c gcc/cgraph.c
+*** gcc.orig/cgraph.c 2010-05-13 09:16:51.617554716 +0100
+--- gcc/cgraph.c 2010-05-13 09:18:23.012547035 +0100
***************
-*** 6150,6155 ****
---- 6150,6160 ----
+*** 181,186 ****
+--- 181,187 ----
+ cgraph_node (tree decl)
+ {
+ struct cgraph_node key, *node, **slot;
++ tree context;
+
+ gcc_assert (TREE_CODE (decl) == FUNCTION_DECL);
+
+***************
+*** 202,213 ****
+ node = cgraph_create_node ();
+ node->decl = decl;
+ *slot = node;
+! if (DECL_CONTEXT (decl) && TREE_CODE (DECL_CONTEXT (decl)) == FUNCTION_DECL)
+ {
+! node->origin = cgraph_node (DECL_CONTEXT (decl));
+! node->next_nested = node->origin->nested;
+! node->origin->nested = node;
+! node->master_clone = node;
+ }
+ return node;
+ }
+--- 203,218 ----
+ node = cgraph_create_node ();
+ node->decl = decl;
+ *slot = node;
+! if (!DECL_NO_STATIC_CHAIN (decl))
+ {
+! context = decl_function_context (decl);
+! if (context)
+! {
+! node->origin = cgraph_node (context);
+! node->next_nested = node->origin->nested;
+! node->origin->nested = node;
+! node->master_clone = node;
+! }
+ }
+ return node;
+ }
+diff -cr gcc.orig/cgraphunit.c gcc/cgraphunit.c
+*** gcc.orig/cgraphunit.c 2010-05-13 09:16:51.620526462 +0100
+--- gcc/cgraphunit.c 2010-05-13 09:18:23.016540000 +0100
+***************
+*** 1150,1155 ****
+--- 1150,1159 ----
+ static void
+ cgraph_expand_function (struct cgraph_node *node)
+ {
++ int save_flag_omit_frame_pointer = flag_omit_frame_pointer;
++ static int inited = 0;
++ static int orig_omit_frame_pointer;
++
+ tree decl = node->decl;
+
+ /* We ought to not compile any inline clones. */
+***************
+*** 1160,1170 ****
+--- 1164,1184 ----
+
+ gcc_assert (node->lowered);
+
++ if (!inited)
++ {
++ inited = 1;
++ orig_omit_frame_pointer = flag_omit_frame_pointer;
++ }
++ flag_omit_frame_pointer = orig_omit_frame_pointer ||
++ DECL_STRUCT_FUNCTION (decl)->naked;
++
+ /* Generate RTL for the body of DECL. */
+ if (lang_hooks.callgraph.emit_associated_thunks)
+ lang_hooks.callgraph.emit_associated_thunks (decl);
+ tree_rest_of_compilation (decl);
+
++ flag_omit_frame_pointer = save_flag_omit_frame_pointer;
++
+ /* Make sure that BE didn't give up on compiling. */
+ /* ??? Can happen with nested function of extern inline. */
+ gcc_assert (TREE_ASM_WRITTEN (node->decl));
+diff -cr gcc.orig/config/i386/i386.c gcc/config/i386/i386.c
+*** gcc.orig/config/i386/i386.c 2010-05-13 09:16:51.656531599 +0100
+--- gcc/config/i386/i386.c 2010-05-13 09:18:23.048527233 +0100
+***************
+*** 6151,6156 ****
+--- 6151,6161 ----
frame->red_zone_size = 0;
frame->to_allocate -= frame->red_zone_size;
frame->stack_pointer_offset -= frame->red_zone_size;
@@ -43,7 +129,7 @@
fprintf (stderr, "\n");
fprintf (stderr, "nregs: %ld\n", (long)frame->nregs);
***************
-*** 22880,22886 ****
+*** 22926,22932 ****
output_set_got (tmp, NULL_RTX);
xops[1] = tmp;
@@ -51,7 +137,7 @@
output_asm_insn ("jmp\t{*}%1", xops);
}
}
---- 22885,22891 ----
+--- 22931,22937 ----
output_set_got (tmp, NULL_RTX);
xops[1] = tmp;
@@ -59,10 +145,11 @@
output_asm_insn ("jmp\t{*}%1", xops);
}
}
-*** gcc-orig/config/rs6000/rs6000.c 2008-05-09 13:13:30.000000000 -0400
---- gcc/config/rs6000/rs6000.c 2008-07-24 10:48:26.000000000 -0400
+diff -cr gcc.orig/config/rs6000/rs6000.c gcc/config/rs6000/rs6000.c
+*** gcc.orig/config/rs6000/rs6000.c 2010-05-13 09:16:51.681526397 +0100
+--- gcc/config/rs6000/rs6000.c 2010-05-13 09:18:23.092525352 +0100
***************
-*** 16929,16935 ****
+*** 16939,16945 ****
C is 0. Fortran is 1. Pascal is 2. Ada is 3. C++ is 9.
Java is 13. Objective-C is 14. Objective-C++ isn't assigned
a number, so for now use 9. */
@@ -70,7 +157,7 @@
i = 0;
else if (! strcmp (language_string, "GNU F77")
|| ! strcmp (language_string, "GNU F95"))
---- 16929,16936 ----
+--- 16939,16946 ----
C is 0. Fortran is 1. Pascal is 2. Ada is 3. C++ is 9.
Java is 13. Objective-C is 14. Objective-C++ isn't assigned
a number, so for now use 9. */
@@ -79,10 +166,11 @@
i = 0;
else if (! strcmp (language_string, "GNU F77")
|| ! strcmp (language_string, "GNU F95"))
-*** gcc-orig/dwarf2out.c 2008-04-28 05:50:31.000000000 -0400
---- gcc/dwarf2out.c 2008-07-24 11:03:16.000000000 -0400
+diff -cr gcc.orig/dwarf2out.c gcc/dwarf2out.c
+*** gcc.orig/dwarf2out.c 2010-05-13 09:16:51.721523312 +0100
+--- gcc/dwarf2out.c 2010-05-13 09:18:23.116522606 +0100
***************
-*** 5540,5546 ****
+*** 5743,5749 ****
return (lang == DW_LANG_C || lang == DW_LANG_C89 || lang == DW_LANG_ObjC
|| lang == DW_LANG_C99
@@ -90,7 +178,7 @@
}
/* Return TRUE if the language is C++. */
---- 5540,5547 ----
+--- 5743,5750 ----
return (lang == DW_LANG_C || lang == DW_LANG_C89 || lang == DW_LANG_ObjC
|| lang == DW_LANG_C99
@@ -100,8 +188,8 @@
/* Return TRUE if the language is C++. */
***************
-*** 13024,13029 ****
---- 13025,13032 ----
+*** 13267,13272 ****
+--- 13268,13275 ----
language = DW_LANG_ObjC;
else if (strcmp (language_string, "GNU Objective-C++") == 0)
language = DW_LANG_ObjC_plus_plus;
@@ -111,7 +199,7 @@
language = DW_LANG_C89;
***************
-*** 14165,14171 ****
+*** 14408,14414 ****
/* For local statics lookup proper context die. */
if (TREE_STATIC (decl) && decl_function_context (decl))
@@ -119,7 +207,7 @@
/* If we are in terse mode, don't generate any DIEs to represent any
variable declarations or definitions. */
---- 14168,14174 ----
+--- 14411,14417 ----
/* For local statics lookup proper context die. */
if (TREE_STATIC (decl) && decl_function_context (decl))
@@ -127,11 +215,12 @@
/* If we are in terse mode, don't generate any DIEs to represent any
variable declarations or definitions. */
-*** gcc-orig/expr.c 2008-03-11 10:16:25.000000000 -0400
---- gcc/expr.c 2008-07-24 11:03:56.000000000 -0400
+diff -cr gcc.orig/expr.c gcc/expr.c
+*** gcc.orig/expr.c 2010-05-13 09:16:51.737528071 +0100
+--- gcc/expr.c 2010-05-13 09:18:23.128525249 +0100
***************
-*** 9205,9210 ****
---- 9205,9215 ----
+*** 9227,9232 ****
+--- 9227,9237 ----
represent. */
return const0_rtx;
@@ -143,10 +232,11 @@
case EXC_PTR_EXPR:
return get_exception_pointer (cfun);
-*** gcc-orig/function.c 2008-02-15 04:55:36.000000000 -0500
---- gcc/function.c 2008-07-24 11:14:14.000000000 -0400
+diff -cr gcc.orig/function.c gcc/function.c
+*** gcc.orig/function.c 2010-05-13 09:16:51.745524338 +0100
+--- gcc/function.c 2010-05-13 09:18:23.144526586 +0100
***************
-*** 3057,3063 ****
+*** 3062,3068 ****
FUNCTION_ARG_ADVANCE (all.args_so_far, data.promoted_mode,
data.passed_type, data.named_arg);
@@ -154,7 +244,7 @@
if (assign_parm_setup_block_p (&data))
assign_parm_setup_block (&all, parm, &data);
---- 3057,3064 ----
+--- 3062,3069 ----
FUNCTION_ARG_ADVANCE (all.args_so_far, data.promoted_mode,
data.passed_type, data.named_arg);
@@ -164,7 +254,7 @@
if (assign_parm_setup_block_p (&data))
assign_parm_setup_block (&all, parm, &data);
***************
-*** 3072,3078 ****
+*** 3077,3083 ****
/* Output all parameter conversion instructions (possibly including calls)
now that all parameters have been copied out of hard registers. */
@@ -172,7 +262,7 @@
/* If we are receiving a struct value address as the first argument, set up
the RTL for the function result. As this might require code to convert
---- 3073,3080 ----
+--- 3078,3085 ----
/* Output all parameter conversion instructions (possibly including calls)
now that all parameters have been copied out of hard registers. */
@@ -182,8 +272,8 @@
/* If we are receiving a struct value address as the first argument, set up
the RTL for the function result. As this might require code to convert
***************
-*** 3202,3207 ****
---- 3204,3212 ----
+*** 3207,3212 ****
+--- 3209,3217 ----
struct assign_parm_data_all all;
tree fnargs, parm, stmts = NULL;
@@ -194,7 +284,7 @@
fnargs = assign_parms_augmented_arg_list (&all);
***************
-*** 4275,4285 ****
+*** 4280,4290 ****
tree parm = cfun->static_chain_decl;
rtx local = gen_reg_rtx (Pmode);
@@ -206,7 +296,7 @@
}
/* If the function receives a non-local goto, then store the
---- 4280,4294 ----
+--- 4285,4299 ----
tree parm = cfun->static_chain_decl;
rtx local = gen_reg_rtx (Pmode);
@@ -223,8 +313,8 @@
/* If the function receives a non-local goto, then store the
***************
-*** 5174,5179 ****
---- 5183,5191 ----
+*** 5179,5184 ****
+--- 5188,5196 ----
#endif
edge_iterator ei;
@@ -234,8 +324,9 @@
#ifdef HAVE_prologue
if (HAVE_prologue)
{
-*** gcc-orig/function.h 2008-01-26 12:18:35.000000000 -0500
---- gcc/function.h 2008-07-24 11:15:42.000000000 -0400
+diff -cr gcc.orig/function.h gcc/function.h
+*** gcc.orig/function.h 2010-05-13 09:16:51.749526942 +0100
+--- gcc/function.h 2010-05-13 09:18:23.148524510 +0100
***************
*** 463,468 ****
--- 463,476 ----
@@ -253,8 +344,9 @@
};
/* If va_list_[gf]pr_size is set to this, it means we don't know how
-*** gcc-orig/gcc.c 2008-03-02 17:55:19.000000000 -0500
---- gcc/gcc.c 2008-07-24 11:25:08.000000000 -0400
+diff -cr gcc.orig/gcc.c gcc/gcc.c
+*** gcc.orig/gcc.c 2010-05-13 09:16:51.761526862 +0100
+--- gcc/gcc.c 2010-05-13 09:18:23.156525598 +0100
***************
*** 129,134 ****
--- 129,137 ----
@@ -366,8 +458,9 @@
/* Here we define characters other than letters and digits. */
case '{':
-*** gcc-orig/gcc.h 2007-07-26 04:37:01.000000000 -0400
---- gcc/gcc.h 2008-07-24 11:26:34.000000000 -0400
+diff -cr gcc.orig/gcc.h gcc/gcc.h
+*** gcc.orig/gcc.h 2010-05-13 09:16:51.765536799 +0100
+--- gcc/gcc.h 2010-05-13 09:18:23.160530017 +0100
***************
*** 37,43 ****
|| (CHAR) == 'e' || (CHAR) == 'T' || (CHAR) == 'u' \
@@ -385,11 +478,12 @@
/* This defines which multi-letter switches take arguments. */
-*** gcc-orig/gimplify.c 2008-05-07 04:00:36.000000000 -0400
---- gcc/gimplify.c 2008-07-24 14:40:20.000000000 -0400
+diff -cr gcc.orig/gimplify.c gcc/gimplify.c
+*** gcc.orig/gimplify.c 2010-05-13 09:16:51.777528337 +0100
+--- gcc/gimplify.c 2010-05-13 09:18:23.172528820 +0100
***************
-*** 5701,5706 ****
---- 5701,5712 ----
+*** 5708,5713 ****
+--- 5708,5719 ----
}
break;
@@ -402,9 +496,29 @@
case TREE_LIST:
gcc_unreachable ();
-*** gcc-orig/tree-dump.c 2008-02-13 06:15:51.000000000 -0500
---- gcc/tree-dump.c 2008-07-24 12:44:35.000000000 -0400
+diff -cr gcc.orig/tree.def gcc/tree.def
+*** gcc.orig/tree.def 2010-05-13 09:16:51.781526751 +0100
+--- gcc/tree.def 2010-05-13 09:18:23.176528351 +0100
***************
+*** 539,544 ****
+--- 539,551 ----
+ arguments to the call. */
+ DEFTREECODE (CALL_EXPR, "call_expr", tcc_vl_exp, 3)
+
++ /* Operand 0 is the FUNC_DECL of the outer function for
++ which the static chain is to be computed. */
++ DEFTREECODE (STATIC_CHAIN_EXPR, "static_chain_expr", tcc_expression, 1)
++
++ /* Represents a function's static chain. It can be used as an lvalue. */
++ DEFTREECODE (STATIC_CHAIN_DECL, "static_chain_decl", tcc_expression, 0)
++
+ /* Specify a value to compute along with its corresponding cleanup.
+ Operand 0 is the cleanup expression.
+ The cleanup is executed by the first enclosing CLEANUP_POINT_EXPR,
+diff -cr gcc.orig/tree-dump.c gcc/tree-dump.c
+*** gcc.orig/tree-dump.c 2010-05-13 09:16:51.781526751 +0100
+--- gcc/tree-dump.c 2010-05-13 09:18:23.180525996 +0100
+***************
*** 646,651 ****
--- 646,655 ----
}
@@ -417,8 +531,9 @@
case CONSTRUCTOR:
{
unsigned HOST_WIDE_INT cnt;
-*** gcc-orig/tree-gimple.c 2007-12-13 16:49:09.000000000 -0500
---- gcc/tree-gimple.c 2008-07-24 12:46:41.000000000 -0400
+diff -cr gcc.orig/tree-gimple.c gcc/tree-gimple.c
+*** gcc.orig/tree-gimple.c 2010-05-13 09:16:51.789525115 +0100
+--- gcc/tree-gimple.c 2010-05-13 09:18:23.180525996 +0100
***************
*** 74,79 ****
--- 74,81 ----
@@ -450,8 +565,9 @@
}
/* Return true if T is a GIMPLE condition. */
-*** gcc-orig/tree-nested.c 2008-05-29 07:35:05.000000000 -0400
---- gcc/tree-nested.c 2008-08-03 10:20:22.000000000 -0400
+diff -cr gcc.orig/tree-nested.c gcc/tree-nested.c
+*** gcc.orig/tree-nested.c 2010-05-13 09:16:51.793527300 +0100
+--- gcc/tree-nested.c 2010-05-13 09:18:23.184533139 +0100
***************
*** 300,305 ****
--- 300,306 ----
@@ -549,8 +665,9 @@
}
/* If a chain_decl was created, then it needs to be registered with
-*** gcc-orig/tree-pretty-print.c 2008-01-27 11:48:54.000000000 -0500
---- gcc/tree-pretty-print.c 2008-07-24 14:31:32.000000000 -0400
+diff -cr gcc.orig/tree-pretty-print.c gcc/tree-pretty-print.c
+*** gcc.orig/tree-pretty-print.c 2010-05-13 09:16:51.797526063 +0100
+--- gcc/tree-pretty-print.c 2010-05-13 09:18:23.188552715 +0100
***************
*** 1251,1256 ****
--- 1251,1266 ----
@@ -570,8 +687,9 @@
case WITH_CLEANUP_EXPR:
NIY;
break;
-*** gcc-orig/tree-sra.c 2008-02-12 13:35:05.000000000 -0500
---- gcc/tree-sra.c 2008-07-24 14:34:07.000000000 -0400
+diff -cr gcc.orig/tree-sra.c gcc/tree-sra.c
+*** gcc.orig/tree-sra.c 2010-05-13 09:16:51.805531760 +0100
+--- gcc/tree-sra.c 2010-05-13 09:18:23.196529148 +0100
***************
*** 262,267 ****
--- 262,269 ----
@@ -597,21 +715,3 @@
saw_one_field = true;
}
-*** gcc-orig/tree.def 2007-10-29 07:05:04.000000000 -0400
---- gcc/tree.def 2008-07-24 14:34:32.000000000 -0400
-***************
-*** 539,544 ****
---- 539,551 ----
- arguments to the call. */
- DEFTREECODE (CALL_EXPR, "call_expr", tcc_vl_exp, 3)
-
-+ /* Operand 0 is the FUNC_DECL of the outer function for
-+ which the static chain is to be computed. */
-+ DEFTREECODE (STATIC_CHAIN_EXPR, "static_chain_expr", tcc_expression, 1)
-+
-+ /* Represents a function's static chain. It can be used as an lvalue. */
-+ DEFTREECODE (STATIC_CHAIN_DECL, "static_chain_decl", tcc_expression, 0)
-+
- /* Specify a value to compute along with its corresponding cleanup.
- Operand 0 is the cleanup expression.
- The cleanup is executed by the first enclosing CLEANUP_POINT_EXPR,
Reply to: