delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1992/12/08/19:58:45

Date: Tue, 8 Dec 1992 09:37 EST
From: "Wonkoo Kim, EE, U. of Pittsburgh" <WKIM AT vms DOT cis DOT pitt DOT edu>
Subject: Re: -O and -O2
To: ESCHN705 AT RZ DOT Braunschweig DOT PTB DOT DBP DOT DE
Cc: djgpp AT sun DOT soe DOT clarkson DOT EDU

In your(ESCHN705 AT RZ DOT Braunschweig DOT PTB DOT DBP DOT DE) code,
>           morg[lm][2+lm] = morg[2+lm][lm] =
>           morg[2*lact-lm][2*(lact-1)-lm] = morg[2*(lact-1)-lm][2*lact-lm] =
>             -0.25*sqrt((lm+1.0)*(lm+2.0)*(2.0*lact-lm)*(2.0*lact-1.0-lm));
tries to access out of bound of memory of the arrary morg[][].

When lact=lm=0, morg[2*lact-lm][2*(lact-1)-lm] is morg[0][-2].
But, you didn't declare the arrary morg[][] so that morg[0][-2] is feasible.
So -O (or -O2) option didn't allow this error.

Wonkoo Kim
EE, U. of Pittsburgh
wkim AT vms DOT cis DOT pitt DOT edu

- Raw text -


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