From owner-freebsd-questions@freebsd.org Sat Jun 10 21:10:53 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3746BF6587 for ; Sat, 10 Jun 2017 21:10:53 +0000 (UTC) (envelope-from serpent7776@gmail.com) Received: from mail-lf0-x244.google.com (mail-lf0-x244.google.com [IPv6:2a00:1450:4010:c07::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 284B52F21 for ; Sat, 10 Jun 2017 21:10:53 +0000 (UTC) (envelope-from serpent7776@gmail.com) Received: by mail-lf0-x244.google.com with SMTP id x81so7211805lfb.3 for ; Sat, 10 Jun 2017 14:10:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=Znz4FkyTj/u1VJMk1jV4IJcVdd3fp95PPyZeWNKNhTQ=; b=qc/yH8a4NijwMNgps0Ykth6zHd2W3Lot+3ElDOHk8XAwUUDa2A2z+BIK6VKztn5PgE ShvIsLJ66slcbCm8RBLnHCa50SON5dalqNeypsFluDkMcqLRIwPIi6GckGEdGBoIyS0U dTyGnimVOlw3Ms40Yi3UE5OBRHf5mmkejzcw7qzXGhBPOSj2VIq/WFYjuoganlq0Xwte NPXzWjux4BsV8+gAUZqoTE8ToL9AER/1wxFnU9pcfcajZLd/tqARVPnywKLwmzBxavZv Uk2pE6Hc+otveeadJNnoYBTfUmHky+7qPZPoUFZU/8GKvsWgN/CvTN+kEgHmjw+bCKxe EEKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Znz4FkyTj/u1VJMk1jV4IJcVdd3fp95PPyZeWNKNhTQ=; b=fgUTH2ga2yzgmrUo2P0xZRt/OJOyc0vCjYqlP3TLO7cay3ALA0ylqkSD+ZwPQH+EFD icm2yoZPa8adD+tZ+Esd+psGx1CpQs+sH0oM4EeB8xUrV4+9ON5IRY6nrn1iRgf/6IJS 9aTt6CSvDw624X6RcbSu+oJ3WDNTShfzrf2i1JwWLROxLrv4ENx8ag1vjVYEK3ruG5nO hKIvEC6xPQZw/uhqYWI4b963qcjrqJGAiniV6+2hNrf0Tcr8ZNxQOclYXmC7LlR317eC DIeAboAMGVbgYHDkDmqq8aPLDzz2zOiiDwbrCil6M87LquSDhhTYl3Krum8QEbBJqyeH 15+A== X-Gm-Message-State: AODbwcBIMBpB5YXlqbKMZ1BWU4QSjR1RcgQkZT2xXrYXwP/rj1J1F1iI Yh3opX4L7xXq1jTk X-Received: by 10.46.13.1 with SMTP id 1mr15291760ljn.134.1497129050817; Sat, 10 Jun 2017 14:10:50 -0700 (PDT) Received: from DaemONX (90-156-31-193.internetia.net.pl. [90.156.31.193]) by smtp.gmail.com with ESMTPSA id y29sm1294789ljd.40.2017.06.10.14.10.50 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jun 2017 14:10:50 -0700 (PDT) Date: Sat, 10 Jun 2017 23:09:28 +0200 From: Serpent7776 To: freebsd-questions@freebsd.org Subject: Re: -O2 flag Message-ID: <20170610230928.581e3cf9@DaemONX> In-Reply-To: <593C4679.5010104@gmail.com> References: <593C4679.5010104@gmail.com> X-Mailer: Claws Mail 3.15.0 (GTK+ 2.24.31; amd64-portbld-freebsd10.3) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jun 2017 21:10:53 -0000 On Sat, 10 Jun 2017 16:20:25 -0300 Friedrich Locke wrote: > Hi folks, > > i am trying compile a program with cc on freebsd 11. > When i use -O2 compilation flag, the compiled code is giving error on > execution, but with i omit -O2 everything works ok. > > Have anybody already faced such problem ? Yes, a few times in the past. Your code may have hidden bug which is triggered only with optimizations enabled. It might be relying on some kind of undefined behaviour. Unfortunately, I don't have any helpful advices on how to find this error - try enabling all compiler warnings flags. I'd suspect a bug in your code rather than a bug in compiler, but the latter is not impossible. > Thanks in advance. > _______________________________________________ > freebsd-questions@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" -- /* * Serpent7776 */