From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2244 invoked by alias); 1 Dec 2003 17:52:57 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 2236 invoked from network); 1 Dec 2003 17:52:57 -0000 Received: from unknown (HELO localhost.redhat.com) (66.30.197.194) by sources.redhat.com with SMTP; 1 Dec 2003 17:52:57 -0000 Received: from gnu.org (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 4F8922B8F; Mon, 1 Dec 2003 12:52:57 -0500 (EST) Message-ID: <3FCB7FF9.4090601@gnu.org> Date: Mon, 01 Dec 2003 17:52:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030820 X-Accept-Language: en-us, en MIME-Version: 1.0 To: fnf@ninemoons.com Cc: gdb-patches@sources.redhat.com Subject: Re: [PATCH] Outwit compiler dead code elimination in break.exp test References: <200311292305.hATN51Uj013311@fred.ninemoons.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-12/txt/msg00018.txt.bz2 > * as places to try setting breakpoints at. They are explicitly > * "one-line functions" to verify that this case works (some versions > * of gcc have or have had problems with this). > + * Recent versions of gcc have gotten smart enough that they will not > + * call functions that have no use or visible side effect, so use > + * globalvar to outwit the compiler for a while longer. Fred, can you clarify exactly under what circumstances this occures? I know that GCC will now, when -O is specified, inline (and thence eliminate) pure functions. However, I don't think that should occure when -O isn't specified. As for stopping GCC from eliminating code - last time this came up (ref store.exp) it was recommended that the .c files be split so that GCC couldn't see the potential optimization. Andrew