re PR target/9164 ([Alpha] improper code generation)

PR target/9164
        * tree.c (get_narrower): For extensions with unchanged bit number,
        return the unsignedness of the outer mode.

        * gcc.c-torture/execute/20030316-1.c: New test case.

From-SVN: r64440
This commit is contained in:
Falk Hueffner 2003-03-16 19:43:53 +00:00 committed by Richard Henderson
parent 1f5a253a36
commit 0a71919d52
4 changed files with 24 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2003-03-16 Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
PR target/9164
* tree.c (get_narrower): For extensions with unchanged bit number,
return the unsignedness of the outer mode.
2003-03-16 Roger Sayle <roger@eyesopen.com>
* c-typeck.c (build_component_ref): Turn "for" into "do .. while"

View File

@ -1,3 +1,7 @@
2003-03-16 Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
* gcc.c-torture/execute/20030316-1.c: New test case.
2003-03-16 Nathan Sidwell <nathan@codesourcery.com>
PR c++/9629

View File

@ -0,0 +1,12 @@
/* PR target/9164 */
/* The comparison operand was sign extended erraneously. */
int
main (void)
{
long j = 0x40000000;
if ((unsigned int) (0x40000000 + j) < 0L)
abort ();
return 0;
}

View File

@ -3958,10 +3958,10 @@ get_narrower (op, unsignedp_ptr)
/* See what's inside this conversion. If we decide to strip it,
we will set WIN. */
op = TREE_OPERAND (op, 0);
if (bitschange > 0)
{
op = TREE_OPERAND (op, 0);
/* An extension: the outermost one can be stripped,
but remember whether it is zero or sign extension. */
if (first)
@ -3980,6 +3980,7 @@ get_narrower (op, unsignedp_ptr)
if (first)
uns = TREE_UNSIGNED (TREE_TYPE (op));
first = 0;
op = TREE_OPERAND (op, 0);
}
win = op;