Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8554309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:51:10+00:00 2026-06-11T14:51:10+00:00

Compiler: Visual C++ 2012 RTM Bug or not?: https://connect.microsoft.com/VisualStudio/feedback/details/763601/visual-c-2012-rtm-serious-compiler-bug To me it seems weird

  • 0

Compiler: Visual C++ 2012 RTM

Bug or not?: https://connect.microsoft.com/VisualStudio/feedback/details/763601/visual-c-2012-rtm-serious-compiler-bug

To me it seems weird it would inline calling test() into the second std::cout statement.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T14:51:11+00:00Added an answer on June 11, 2026 at 2:51 pm

    Yes. The compiler is free to make changes that are undetectable to the program. Since the test function has no externally-visible effects, the compiler is free to make it as early or late as it wishes, or even eliminate it entirely.

    If you can explain some way this optimization made your code do something it shouldn’t do, then you have something. But so far, your only claim is that it made your code run slower or faster. The compiler is free to make optimizations that make some parts of your code slower and some parts faster. In fact, that’s the essence of optimization — making performance tradeoffs that we hope will generate a net gain. That may result in poor quality generated code, though in this case it doesn’t seem to, but it’s most certainly valid. That’s what optimization is all about.

    A compiler takes your source code and produces output compiled code. It is free to build any compiled code it likes so long as it produces the observable results your source code asks it to produce. It is not required to produce the output the same way your source code does if it can find a way to produce the same effects in a way that it thinks is better. This is the whole point of optimization — to not do literally what you asked it to do but to produce the same results some other, hopefully better, way.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using the commandline visual basic compiler (vbc.exe) with option VBruntime- does not allow using
I am using a makefile system with the pvcs compiler (using Microsoft Visual C++,
I was wondering if, and to what degree, does Microsoft's Visual C++ compiler conform
I've installed Visual Studio C++ Express 2012 and want to use it's compiler with
I've tried compiling this with Visual Studio 2012 RC and Intel C++ Compiler XE
I'm porting some code to Windows, and the Microsoft compiler (Visual C++ 8) is
Language: C# Compiler: Visual Studio 2012 O/S: Windows 7 Home Premium I have been
OS: Windows 7 Home Premium Compiler: Visual Studio 2012 Language: ASP.net C# 4 Additional
When the following project is compiled, I get the following compiler error: (Visual Studio
Why is the Visual C++ compiler calling the wrong overload here? I am have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.