www.delorie.com/archives/browse.cgi   search  
Mail Archives: pgcc/1998/05/10/03:39:12

X-pop3-spooler: POP3MAIL 2.1.0 b 4 980420 -bs-
Delivered-To: pcg AT goof DOT com
Date: Sat, 9 May 1998 22:36:36 -0500
From: Leland Ray <leland AT wolfram DOT com>
Message-Id: <199805100336.WAA25254@wolfram.com>
To: pgcc-list AT Desk DOT nl
Subject: problem with -funroll-all-loops
Cc: leland AT wolfram DOT com
Sender: Marc Lehmann <pcg AT goof DOT com>
Status: RO
X-Status: AF
Lines: 49

Greetings.

This problem happens when I use -funroll-all-loops. Here is a small test
program that shows what is happening:

(incorrect result):

godot [1] leland> cc -O6 -mpentiumpro -malign-double -mstack-align-double -funroll-all-loops t1.c
godot [2] leland> a.out
da1 = 5
after loop, da1 = -1

(correct result):

godot [3] leland> cc -O6 -mpentiumpro -malign-double -mstack-align-double t1.c
godot [4] leland> a.out
da1 = 5
after loop, da1 = 1

Here is the test program in question:
-----------------------------

#include <stdio.h>

int a[] = { 1, 3, 0, 0, 0, 1 };

main() {
    int da1 = 5;

    printf ("da1 = %d\n", da1);
    while (--da1 >= 0 && !a[da1]);
    printf ("after loop, da1 = %d\n", da1);
}


Version information:

godot [7] leland> gcc -v
Reading specs from /usr/lib/gcc-lib/i586-pc-linux-gnulibc1/pgcc-2.91.24/specs
gcc version pgcc-2.91.24 19980418 (gcc2 ss-980401 experimental)
godot [8] leland>                

-------------------------------------------

Leland Ray
Manager, Release Engineering
Wolfram Research, Inc.
leland AT wolfram DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019